0 Replies Latest reply on Oct 16, 2013 5:09 AM by Milko Krastev

    MessageDriven beans subscribed to Topic in clustered environment in JBoss 7.1.2

    Milko Krastev Newbie



      I came across the following problem. Three JBoss 7.1.2 servers, let's call them A, B, C work in domain mode. There is one clustered topic and an EAR deployed to the domain. When deploying that EAR to the domain, A, B and C get a copy and respectively a MessageDriven bean within the EAR that is supposed to listen to the topic and get activated when a new message arrives at the topic. However, instead of invoking the message driven bean 3 times - once for A, once for B, and once for C, it's called just once for all three in a round Robin fashion.


      Basically, I keep a cache map of properties on each node, initialized via a Singleton session bean at start up, and the topic serves as a notifier for changes in the map. So I need to have these changes take place in all three nodes of the cluster. And the MDB gets activated just once for all three nodes. To work around this problem, I currently use other Singleton beans that register themselves explicitly as subscribers to the topic implementing MessageListener. That's fine, but leads to a lot of code plumbing, and now the project expands and I have to create many more topics.


      What's the way of forcing an MDB in an EAR deployed to a domain to get executed once for every node of the domain, when listening to a clustered topic?


      Any help would be much appreciated!