0 Replies Latest reply on Sep 23, 2011 2:47 PM by dhoyt

    Issue with topics in a clustered Servicemix environment

    dhoyt

      Background:

      I have two instances of ServiceMix (apache-servicemix-4.3.1-fuse-02-05) clustered in a Network of Brokers.  I add a producer (just a timer that writes to a JMS topic) on one of the instances and a consumer on each of the instances.  Even though I use the same clientId and durableSubscriptionName for both consumers, each instance picks up the message.  This is not what I was expecting.  What I was expecting was that if one of the consumers picked up the new message, the other consumer would not.

       

      After looking into this for a while, I found the concept of Virtual Topics.  When I configured my routes to use virtual topics, the consumers stopped picking up the messages at all.  In fact, the ActiveMQ web console on the instance without the producer didn't even show the topic as existing.

       

      Finally, my question:

      I want to be able to deploy consumers to all instances in my cluster and have only one of them pick up a new message to avoid duplicated.  How do I go about doing that?  Below are my 4 routes (consumer/provider with and without virtual topics).  Any help in figuring out what I am doing wrong would be greatly appreciated.

       

       

       

      Non-Virtual Producer Route (deployed to one instance):

       

       

      Non-Virtual Consumer Route (deployed to one instance):

       

       

       

       

      Virtual Producer Route (deployed to one instance):

       

       

       

       

      Virtual Consumer Route (deployed to two instances):