9 Replies Latest reply on Jul 26, 2013 10:42 AM by Miroslav Novak

    JBOSS 7.1.3 EAP MDB is not able to consume 10000 Messages

    S V S G Krishna Murthy K Novice

      Hi,

       

      I've a JBOSS 7.1.3 EAP Version where we are publishing more than 10 thousand messages.Consumer is consuming only 6 thousand messages,and then I found the below exception.

       

       

      ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (Thread-548 (HornetQ-client-global-threads-1138595655)) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

       

       

      Can you suggeset me in this please

       

      Thanks

      Deev

        • 2. Re: JBOSS 7.1.3 EAP MDB is not able to consume 10000 Messages
          S V S G Krishna Murthy K Novice

          Thanks Justin for Reply.Here is the stack Trace.

           

           

          Iam running 15 Sessions of MDB which are by default.

          21:40:03,465 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (JBossWeb-threads - 82) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

          21:40:33,510 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (JBossWeb-threads - 82) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

          21:41:03,533 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (JBossWeb-threads - 82) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

          21:41:33,580 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (JBossWeb-threads - 82) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

          21:42:03,603 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (JBossWeb-threads - 82) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

          21:42:33,726 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (JBossWeb-threads - 82) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

          21:43:03,747 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (JBossWeb-threads - 82) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

          21:43:33,804 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (JBossWeb-threads - 82) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

          21:43:51,574 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655)) javax.transaction.SystemException: TransactionImple.enlistResource - XAResource.start ARJUNA016054: could not register transaction: < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a05a683:4af5af2c:51ea4344:17f90d, node_name=1, branch_uid=0:ffff0a05a683:4af5af2c:51ea4344:182021, subordinatenodename=null, eis_name=java:/JmsXA >

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:687)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:397)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.enlist(TxConnectionListener.java:587)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:264)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:467)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:599)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:467)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(HornetQRASessionFactoryImpl.java:837)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at org.hornetq.ra.HornetQRASessionFactoryImpl.createQueueSession(HornetQRASessionFactoryImpl.java:237)

          21:43:51,576 ERROR [stderr] (Thread-2020 (HornetQ-client-global-threads-1138595655))      at net.deev.Publisher.publishMessage(Publisher.java:36)

           

           

          Code:

          package net.deev;

           

          import javax.jms.Queue;

          import javax.jms.QueueConnection;

          import javax.jms.QueueConnectionFactory;

          import javax.jms.QueueSender;

          import javax.jms.QueueSession;

          import javax.jms.Session;

          import javax.jms.TextMessage;

          import javax.naming.InitialContext;

           

          public class Publisher

          {

           

           

              public static void publishMessage(String message)

              {

                  QueueConnectionFactory qconFactory;

                  QueueConnection qcon = null;

                  QueueSession qsession = null;

                  QueueSender qsender = null;

                  Queue queue;

                  TextMessage msg = null;

           

                  try

                  {           

                      //*************** Connection Factory JNDI name *************************

                      String CNN_FACTORY="/JmsXA";

           

                      //*************** Connection Factory JNDI name *************************

                      String QUEUE_NAME="queue/OrdersQ";

           

                      InitialContext ctx = new InitialContext();

                      qconFactory = (QueueConnectionFactory) ctx.lookup(CNN_FACTORY);

                      qcon = qconFactory.createQueueConnection();

                      qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

                      queue = (Queue) ctx.lookup(QUEUE_NAME);

                      qsender = qsession.createSender(queue);

                      msg = qsession.createTextMessage();

                      qcon.start();

           

                      msg.setText(message);     // Messages

                         qsender.send(msg);     // Messages sent

           

                  }

                  catch(Exception exception)

                  {

                         Log(            exception.getMessage(),            exception);

                  }

                  finally

                  {

                      try

                      {

                          if(qsession!=null)

                              qsession.close();

                          if(qsender!=null)

                              qsender.close();

                      if(qcon!=null)

                      {

                          qcon.close();

                      }

                      }

                      catch(Exception e)

                      {

                              Log(                e.getMessage(),                e);

                      }

                  }

           

              }

           

          }

          • 4. Re: JBOSS 7.1.3 EAP MDB is not able to consume 10000 Messages
            Stephen Coy Master

            Is it possible that your consumers are blocking somewhere?

             

            A thread dump when the problem has occurred might reveal something.

             

            Also, is the code above called from within the same VM that is consuming the messages?

            • 5. Re: JBOSS 7.1.3 EAP MDB is not able to consume 10000 Messages
              S V S G Krishna Murthy K Novice

              Thanks Stepehn for ur answer,

               

              Actually I have sslb size in standalone-full.xml as 3000.But I'm publishing more than 3000 Records.Is that matters.And,MDB Strict pool size is 180.I'm not getting any other errors in Logs..When I restart JBOSS,It is picking some of messages.And again,it gets stopped consuming..It's showing very strange behaviour.I'm running default sessions in MDB.The code is calling from save VM.

               

              Thanks

              DeenKrishn

              • 6. Re: JBOSS 7.1.3 EAP MDB is not able to consume 10000 Messages
                Stephen Coy Master

                Can you please show us:

                1. The code for your MDB
                2. A thread dump after the MDB has stopped consuming messages
                • 7. Re: JBOSS 7.1.3 EAP MDB is not able to consume 10000 Messages
                  S V S G Krishna Murthy K Novice

                  My MDB Code:

                   

                  package net.deen.mdm.messaging.consumers;

                   

                   

                   

                  import java.util.HashMap;

                   

                   

                   

                  import javax.annotation.security.RunAs;

                   

                  import javax.ejb.ActivationConfigProperty;

                   

                  import javax.ejb.EJB;

                   

                  import javax.ejb.EJBContext;

                   

                  import javax.ejb.MessageDriven;

                   

                  import javax.jms.JMSException;

                   

                  import javax.jms.Message;

                   

                  import javax.jms.MessageListener;

                   

                  import javax.jms.ObjectMessage;

                   

                  import javax.naming.InitialContext;

                   

                  import javax.persistence.EntityManager;

                   

                  import javax.persistence.PersistenceContext;

                   

                   

                   

                  @MessageDriven(activationConfig =

                   

                  {

                   

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

                   

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

                   

                          @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "15")})

                   

                   

                   

                  @RunAs("default")

                   

                  public class CreateOutletConsumer implements MessageListener 

                   

                  {

                   

                      @EJB

                   

                      MdmManagementLocal mdmManagementLocal;

                   

                   

                   

                      @EJB

                   

                      MdmUtilityManagementLocal mdmUtilityManagementLocal;

                   

                   

                   

                      @PersistenceContext(unitName = "net.deen.dev")

                   

                      EntityManager entityManager;

                   

                   

                   

                      @Override

                   

                      public void onMessage(Message message)

                   

                      {

                   

                          try

                   

                          {

                   

                              ObjectMessage objectMessage = (ObjectMessage) message;

                   

                              BulkUploadRequest bulkUploadRequest = (BulkUploadRequest) objectMessage.getObject();

                   

                              if (TLogger.debugIsEnabled())

                   

                              {

                   

                                  TLogger.debug("In consumer :" +bulkUploadRequest.getServiceRow());

                   

                              }

                   

                              try

                   

                              {

                   

                                   mdmManagementLocal.processRequest(bulkUploadRequest.getServiceRow());

                   

                              }

                   

                              catch(Exception applicationException)

                   

                              {

                   

                                  TLogger.debug("Error OCcurred");

                   

                              }

                   

                              mdmUtilityManagementLocal.updateRequest(bulkUploadRequest);

                   

                   

                   

                          }

                   

                          catch (JMSException jmsException)

                   

                          {

                   

                              net.deen.common.logger.TLogger.error(jmsException.getMessage(),jmsException);

                   

                          }

                   

                          catch(Exception exception)

                   

                          {

                   

                              net.deen.common.logger.TLogger.error(exception.getMessage(),exception);

                   

                          }  

                   

                      }

                   

                  }

                   

                  My Publisher code is above.

                   

                  Please find the attached dump.

                   

                  Thanks

                  DeenKr

                  • 8. Re: JBOSS 7.1.3 EAP MDB is not able to consume 10000 Messages
                    Stephen Coy Master

                    This appears to be a log file extract. I would like to see a thread dump created using jstack when the server is in the error state that you're seeing above.

                    • 9. Re: JBOSS 7.1.3 EAP MDB is not able to consume 10000 Messages
                      Miroslav Novak Master

                      From the attached log I believe you hit:

                      https://issues.jboss.org/browse/HORNETQ-1117

                       

                      Could you try to update to newer version AS 7.2/EAP 6.1.

                       

                      Cheers,

                       

                      Mirek