title: how to create multiple instances of activemq topic subscribers using virtual destinations?
body: <p>I have a publisher that is pushing messages to a topic. I have multiple subscribers each doing a different task once they consume the message from the topic. 
  Now I want my system to scale to multiple instances of the same process running on different hosts/same host. e.g. I want to run multiple copies of my application A on different hosts so that if one instance of A is slow, then the other instances can pull in subsequent messages and make forward progress..
  I found out that this is possible using virtual destinations. I followed the steps here - 
  <a href="http://activemq.apache.org/virtual-destinations.html" rel="noreferrer">http://activemq.apache.org/virtual-destinations.html</a></p>
  
  <p>But how do i setup my multiple subscribers to the same topic with the same client id? when i try to do that, i get errors. when i try some other way, it doesn't work. can someone help?</p>
  
  <p>Normally, I start a subscriber by doing the below steps - </p>
  
  <pre><code>        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_USER, ActiveMQConnection.DEFAULT_PASSWORD, ActiveMQConnection.DEFAULT_BROKER_URL;);
          activeMQConnection = connectionFactory.createConnection();
  
          activeMQConnection.setClientID("subscriber1");
          activeMQConnection.setExceptionListener(exceptionListener);
          activeMQSession = activeMQConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
          activeMQTopic = activeMQSession.createTopic("myTopic");            
          activeConsumer = activeMQSession.createDurableSubscriber(activeMQTopic, "myTopic");            
          activeConsumer.setMessageListener(messageListener);
          activeMQConnection.start();
  </code></pre>
  
  <p>when i try to create a 2nd subscriber and pass the topic name as "VirtualTopic.myTopic", nothing happens.</p>
  
  <p>thanks</p>