8 Replies Latest reply on Jan 18, 2013 5:05 AM by ataylor

    Multiple Subscribers to a durable topic

    pacodelucia

      Hi

       

      I read some post about this. Im not sure if I understood it completely and what solutions would exist in a JEE environment:

       

      We are deploying our JEE-Application (with EJB 3.0) on two physical machines running jboss. We are not clustering anything and just put a load balancer in front of the two machines. HornetQ is running on a third machine and we are connecting using a remote connection to this hornetq server. On the two Jboss instances we have an MDB running consuming from a durable topic. It seems not possible to consume from the two jboss instances using the same topic. What we are trying to do is some kind of load balancing. Message one is consumed by MDB running on jboss one and Message Two is consumed by the other instance etc. This seems not possible because I get the following exception:

       

      javax.jms.IllegalStateException: Cannot create a subscriber on the durable subscription since it already has subscriber(s)

       

       

      As I understand it this is not allowed by the JSF-Spec... It surprises me somehow because I can do the same with normal queue without any problems.

       

      The only option I currently see is to use a queue and to implement an mdb that distributes the messages to other queues ("subscribers"). Can anyone think of a different solution?

       

      What I also don't understand is the purpose for the subscriptionName in the activation config. There is also a clientID. What is the purpose for having a subscriptionName in addition to a clientID if I cannot listen with two clients to the same subscription?

       

      Thanks and regards

      Oliver