Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • inside my subscribe method, I was asynchronously calling service layer like subscriableService.registerAndHandleWith(new Handler(){}). So that I can't return immediately in this method. What would you recommend in this scenario? Thanks. Commented Mar 22, 2015 at 15:35
  • Future.get() or CountDownLatch from that registerAndHandleWith. From other side you can access to the SimpleBrokerMessageHandler and populate some your custom impl of DefaultSubscriptionRegistry to override addSubscriptionInternal to raise some custom ApplicationEvent to listen to it from some another component to send that message to the topic, when subscription will be there already. It is for case, when you really need an async stuff and don't overload clientInboundChannel executor to wait for that Future. Commented Mar 22, 2015 at 18:39
  • 1
    Thanks again Artem, I assume that I can't use the existing SessionSubscribeEvent as it only tells me that the client has requested but doesn't mean the subscription registration is completed (it would be nice to have something like SessionSubscribedEvent). Commented Mar 22, 2015 at 20:34
  • 1
    Yes, you are correct: a SessionSubscribeEvent event is emitted before the real subscription is done. Feel free to raise a JIRA ticket for the SessionSubscribedEvent. Commented Mar 23, 2015 at 6:37