Announcement Announcement Module
Collapse
No announcement yet.
Differences between M6 and GA Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Differences between M6 and GA

    Hello,

    I'm using Spring Integration to build a JMS Publish/Subscribe message broker. One of the requirements is that it has to support dynamic (un)subscribe. So at runtime, subscribers can be added or removed.
    This was quite ease in M6, to unsubscribe:

    Code:
    String subscriberQueue = (String) object.getHeaders().get("spring.integration.user.jms.QUEUE");
                String topic = (String) object.getHeaders().get("spring.integration.user.jms.TOPIC");
                PublishSubscribeChannel pubSubChannel = (PublishSubscribeChannel) BrokerStarter.context.getBean(topic);
                MessageBus messageBus = (MessageBus) BrokerStarter.context.getBean("internal.MessageBus");
                MessageEndpoint endPoint = messageBus.lookupEndpoint(subscriberQueue);
                pubSubChannel.unsubscribe(endPoint);
                messageBus.unregisterEndpoint(subscriberQueue);
                deleteSubscriberQueue(subscriberQueue);
    In GA, this is much harder, since you there is no MessageBus object anymore and you loose the ability to lookup endpoints.
    Is there an alternative in SI GA ?

    thnx
    Ivanjoe

  • #2
    On a SubscribableChannel, you can call unsubscribe(handler). You'll have to stop the endpoint yourself if that is required, but that's still less code I think. If you figure it out, please post your code back here, so we can see if we can make it simpler.

    Comment


    • #3
      Thnx for your quick reply.

      I'm aware of the unsubscribe(MessageHandler) method on the SubscribableChannel interface, but the problem is to get the MessageHandler reference.
      In my case, the actual implementation is a JmsSendingMessageHandler object. In M6, you could do a lookup on the MessageBus to get this object. In GA, this is not possible anymore, since the context is the MessageBus.

      Any ideas on how to get the reference to this MessageHandler class ?

      thnx
      ivanjoe

      Comment


      • #4
        Originally posted by ivanjoe View Post
        Thnx for your quick reply.
        Any ideas on how to get the reference to this MessageHandler class ?
        I assume that you mean the instance. Any reason that a getBean(..) or dependency injection isn't working for you?

        Comment

        Working...
        X