[jboss-user] [JBoss Messaging] - two server cluster - consumer count 2

kpirkl@elynx.com do-not-reply at jboss.com
Tue Jun 19 13:31:28 EDT 2007


I am using messaging 1.3 with JB 4.2 clustered on two servers
I have a standalone client application running on both servers
The server names are jbossclust1 and jbossclust2

When I start the client applications the Queue ConsumerCount on jbossclust2 is 2.
I would expect the ConsumerCount to be 1 on both machines

Here is the relevant client code.

        String strQueue           = "/queue/testDistributedQueue";

         ic = new InitialContext();

         cf = (ConnectionFactory)ic.lookup("/ClusteredConnectionFactory");

         connection = cf.createConnection();

         Queue testQueue    = (Queue)ic.lookup(strQueue);

         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

         // task queue
         MessageConsumer consumer =  session.createConsumer(testQueue);

         connection.start();

         while(true)  {

           // if we get an admin shutdown message - exit
           if ( false )  {
             log("  shutdown requested");
             break;
           }

           // get a task to process
           message = (TextMessage)consumer.receive(36000);

           if ( message == null )  {
             log("  no messages available");
             continue;
           }

           log("  found a message - continuing");

           ProcessMessage(message);
         }

Suggestions please...



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055750#4055750

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055750



More information about the jboss-user mailing list