Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

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

scott.stark@jboss.org

2007-06-19


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
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.