NaikSoftware / StompProtocolAndroid

STOMP protocol via WebSocket for Android
MIT License
597 stars 265 forks source link

Do you support multiple topic subscriptions? #204

Closed TangStudio closed 3 years ago

TangStudio commented 3 years ago

Do you support multiple topic subscriptions? Like this: Disposable dispTopic = mStompClient.topic("/topic/greetings") .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(topicMessage -> { Log.d(TAG, "Received " + topicMessage.getPayload()); addItem(mGson.fromJson(topicMessage.getPayload(), EchoModel.class)); }, throwable -> { Log.e(TAG, "Error on subscribe topic", throwable); });

    compositeDisposable.add(dispTopic);

Disposable dispTopic2 = mStompClient.topic("/topic/greetings2") .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(topicMessage -> { Log.d(TAG, "Received " + topicMessage.getPayload()); addItem(mGson.fromJson(topicMessage.getPayload(), EchoModel.class)); }, throwable -> { Log.e(TAG, "Error on subscribe topic", throwable); });

    compositeDisposable.add(dispTopic2);