0 Replies Latest reply on Jul 10, 2013 4:59 AM by erasmo2 marciano2

    JMS Queue Cluster consumer doesn't works correctly

    erasmo2 marciano2 Master



      I have this client Client Jms


                  Queue queue = new HornetQQueue("testQueue");

                  Map<String, Object> connectionParams = new HashMap<String, Object>();

                  connectionParams.put(TransportConstants.CLUSTER_CONNECTION, "");    

                  TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), connectionParams);

                  ConnectionFactory cf = (ConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(new DiscoveryGroupConfiguration(groupAddress, groupPort),




      When i run the codes following:


                   MessageConsumer consumer = session.createConsumer(queue);

                  //Message can also be consumed from here:

                  for (int i = 0; i < 1000; i++) {  

                      message = (TextMessage) consumer.receive(3000);





      I consumer the messages only on JBOSSA ?


      Why does this happen?


      If I run my client Jms for second time  I consume the messages on JBOSSB


      add my code cluster-connections



                          <cluster-connection name="my-cluster">







                              <discovery-group-ref discovery-group-name="my-discovery-group"/>







      Thank You