2 Replies Latest reply on Mar 3, 2013 9:52 PM by Yong Hao Gao

    consumer on one node stop getting messages

    sam issac Newbie

      Hi,

       

      On our production env we are using a  3 node cluster setup . (jboss 6.0.0.Final, default hornetq which is version 2.1.2). All three nodes have the same configurations. There are two types of producers , one runs on node 1 and the other on node 2.

      The code was working fine and the messages were being sent properly about  100/minute. All of a sudden 5 days back,  one node doesn't get messages for about 2 minutes, then it starts to work. Then again for another node messages doesn't come for about 10, then everything resumes working.  Not sure what is causing this. There is nothing in the logs. Any Help is a great  Help

       

      Another question is how can I enable more logging ? how to enable debug

       

      hornetq-jms.xml:  (same on all 3 nodes)

       

      </configuration>

      .............

      <connection-factory name="NettyConnectionFactory">

            <connectors>

               <connector-ref connector-name="netty"/>

            </connectors>

            <entries>

               <entry name="/ConnectionFactory"/>

               <entry name="/XAConnectionFactory"/>

            </entries>

         </connection-factory>

      ------------

              <queue name="Multi-A">

                      <entry name="queue/tt/AQueue"/>

              </queue>

              <queue name="Multi-B">

                      <entry name="queue/tt/BQueue"/>

              </queue>

       

      </configuration>

       

       

      Producer code: which runs on Node1 and Node2

       

      On Node1 :

      _queueName = queue/tt/AQueue

      _namingProviderURL = jnp://172.17.55.101:1099

       

       

      On Node2 :

      _queueName = queue/tt/BQueue

      _namingProviderURL = jnp://172.17.55.101:1099

       

       

      code:

              Properties contextProperties = new Properties( );

              contextProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

              contextProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");

              contextProperties.put(Context.PROVIDER_URL, _namingProviderURL);

              Context context = new InitialContext(contextProperties);

              Queue queue = (Queue) context.lookup(_queueName);

              ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("ConnectionFactory");

              context.close();

              _connection = connectionFactory.createConnection();

              _session = _connection.createSession(false, QueueSession.AUTO_ACKNOWLEDGE);

              _messageProducer = _session.createProducer(queue);

              _message = _session.createObjectMessage();

             

       

              read messages from DB and populate "request" object

              loop start

                {

              _message.setObject(request);

              _messageProducer.send(_message, DeliveryMode.NON_PERSISTENT, 9, 100000)

             }

       

      Consumer code on Node1 , Node 2, Node 3   -- all Nodes has the MDBs deployed. There are 2 types of MDBs as below

       

      MDB-1

      @MessageDriven(activationConfig = {

          @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),

          @ActivationConfigProperty(propertyName="destination", propertyValue="queue/tt/AQueue"),

          @ActivationConfigProperty(propertyName="maxSession",propertyValue="200")

      })

      @Pool(value=PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX,maxSize=150,timeout=60000)

      public class ARequestProcessorMDB extends RProcessorMDB implements MessageListener {

       

       

             public void onMessage(Message message) {

                

                     request = (Request) ((ObjectMessage) message).getObject();

          }   

       

       

      }

       

      MDB -2

      @MessageDriven(activationConfig = {

          @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),

          @ActivationConfigProperty(propertyName="destination", propertyValue="queue/tt/BQueue"),

          @ActivationConfigProperty(propertyName="maxSession",propertyValue="200")

      })

      @Pool(value=PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX,maxSize=150,timeout=60000)

      public class BRequestProcessorMDB extends RProcessorMDB implements MessageListener {

       

       

             public void onMessage(Message message) {

                

                     request = (Request) ((ObjectMessage) message).getObject();

          }   

       

       

      }