Announcement Announcement Module
No announcement yet.
Load balancing/sharing topic listener within a cluster Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Load balancing/sharing topic listener within a cluster

    I'm using Spring JMS within tomcat container to publish/consume messages. There are different subsystems within one large application. Each of the subsystem runs under its own tomcat container

    I have a requirement where each of the subsystems running under different Webserver containers need to process a topic message concurrently. However within a subsystem there should be only one topic listener processing the topic message. In a single server instance this works fine as I configure just one MDB topic listener within a subsystem. However when the subsystem runs under a cluster each of the server instances within the cluster processes the topic message concurrently. How can I ensure only one instance within the cluster consumes the topic message.


  • #2
    Some brokers (e.g. SonicMQ) allow you to configure the topic so only one consumer with a particular client id can connect. When the active component fails, the broker allows one of the others to connect. But this isn't standard in JMS; you'd have to look at your broker's documentation to see if that's possible.

    You can either distribute the work with Queues instead of Topics or use a management tool (via JMX) to start/stop the listener containers to ensure there's only one consumer of a particular type.


    • #3
      Thanks for the lead, it helped resolve the issue. This is working using Sonic's Group subscription