Closed TangStudio closed 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);
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); });
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); });