1 Reply Latest reply on Oct 25, 2012 12:13 AM by raysen_jia

    Static Cluster Discovery, How to configure Comsumer Cluster

    raysen_jia Newbie

      Dear Team,


      I want get the consumer to receive all the messages send to node1(10.***.***.101), node2(10.***.***.102), but I don't know how to configure it, following is my context, could you please help me?


      1. HornetQ Version is 2.2.14Final

      2. Two HornetQ server with static connection, with the following kind of connection


      <connector name="hornetq2.ec">
                 <param key="host" value="hornetq2.ec" />
                 <param key="port" value="5445" />
            <cluster-connection name="my-cluster">

      3. Consumer with the following configure, only connect to one jms connection factory


                Hashtable<String, String> env1 = new Hashtable<String, String>();
                  env1.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
                  env1.put("java.naming.provider.url", "jnp://10.***.***.101:1099");
                  env1.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
                  // Step 1. Create an initial context to perform the JNDI lookup.
                  initialContext1 = new InitialContext(env1);
                  // Step 2. Perfom a lookup on the queue
                  Queue queue = (Queue) initialContext1.lookup("/queue/OtherQueue");
                  // Step 3. Perform a lookup on the Connection Factory
                  ConnectionFactory cf1 = (ConnectionFactory) initialContext1.lookup("/ConnectionFactory");


      4. This consumer can only consumer the message from hornetQ server 10.***.***.101, cannot receive the message from hornetQ server 10.***.***.102

      5. How to config the consumer to receive all messages of the two hornetQ servers?



      Best Regards,

      Raysen Jia