0 Replies Latest reply on Apr 13, 2011 11:08 AM by Sebastian Brandt

    Exclusive consumer possible in clustered ActiveMQ / SM3 / JBossAS config?

    Sebastian Brandt Newbie

      Hi,

      I have trouble configuring ActiveMQ's exclusive consumer feature for clustered consumers: I'd like messages in a queue to be delivered only to one consumer with auto-failover to another standy-by consumer. Problem is: both consumers still receive messages.

       

      First I tried to configure the "consumer.exclusive" destination option into jms:consumer/destinationName element on both nodes:

       

      <jms:consumer destinationName="queue/TEST?consumer.exclusive=true" ... />

       

      That didn't work - both consumers still receive messages. I suspected the destination option didn't make it to ActiveMQ, so a custom destination resolver was deployed:

       

      public class JmsDestinationResolver implements DestinationResolver {

      public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException {

      return session.createQueue(destinationName + "?consumer.exclusive=true");

      }

      }

       

      I checked in the debugger that the resolver class was actually used. But still both consumers receive messages

       

      Any ideas? Has someone used that feature already in a SM3 setup? Can exclusive consumer feature work at all in our setup?

       

      Cheers!

      Sebastian

       

      (Setup is: Service Mix 3.4.0.4 and ActiveMQ 5.3.0 deployed in JBossAS 5.1.0 GA, cluster with two machines, ActiveMQ broker configured in hot-standby mode)

       

      Edited by: sbrandt on Apr 13, 2011 3:04 PM

       

      Edited by: sbrandt on Apr 13, 2011 3:07 PM