Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the onComplete() call back does not get trigred after subscribe : #12

Open
mohdFathi opened this issue May 7, 2020 · 3 comments
Open

Comments

@mohdFathi
Copy link

the onComplete() call back does not get trigred after subscribe method :

mStompClient.topic("/topic/hello").subscribe(new Subscriber<StompMessage>() {

           @Override
           public void onSubscribe(Subscription s) {
               Log.d("listenStomp", "onSubscribe");
           }

           @Override
           public void onNext(StompMessage stompMessage) {
               Log.d("listenStomp", "onNext");
               Log.d(TAG, "Received " + stompMessage.getPayload());
           }

           @Override
           public void onError(Throwable t) {
               Log.d("listenStomp", "onError", t);
           }

           @Override
           public void onComplete() {//this is not trigreed after succesful subscribe
               Log.d("listenStomp", "onComplete");
           }
       });
@forresthopkinsa
Copy link
Owner

onComplete signals the end of the stream, not the success of the subscription.

@mohdFathi
Copy link
Author

mohdFathi commented May 7, 2020

oook , what if I want to be notified upon successful subscription.
I have tried @SubscribeMapping and listening for SessionSubscribeEvent on the back-end but both do not get triggered after subscription...any ideas?

@forresthopkinsa
Copy link
Owner

You shouldn't need to listen for a successful subscription. You should be ready to respond to events as soon as you subscribe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants