1 Reply Latest reply on Jun 11, 2011 10:06 AM by Mark Paluch

    JBoss 6 Clustering and Message Beans

    Glen Miller Newbie

      I am working on a problem that seems to fit into the publish/subscribe messages very well.  I need to have an unknown number of message beans listening for messages.  This works well in a non clustered environment, but when I add more servers to the cluster the same message is delieverd to each message bean on each cluster, which I think is normal correct behavior.  I need something a little different though.  I need the message to be delieverd once to each type of message bean listening to the topic.  So even though Test1MB and Test2MB are deployed on Server1 and Server2 - I need only 1 Test1MB and only 1 Test2MB doesnt matter which server to process the message.  Can the topic or the message bean be configured this way?


      1 Solution I can think of is to use multiple queues instead of 1 topic.


      Have a message bean listening to a main queue for the messages and forward the message onto bean specific queues.  The reason i dont like this is it requires 1 queue for every message bean, and everytime a new bean type becomes a listener the first message bean has to be modified to know about a new queue to forward the message onto.


      Hoping there is a better way.



        • 1. Re: JBoss 6 Clustering and Message Beans
          Mark Paluch Master

          Hi Glen,

          in your scenario: topic = the same message is processed two times (by Server A and Server B), queue = the message is processed one time (either by Server A OR by Server B).

          As long as you haven't configured queue replication the message should be processed on the server on which the message was created. Messages usually get loaded from the queue on startup (it's important to know, when you persist these in a common used database).


          Best regards,