7 Replies Latest reply on Jun 4, 2011 12:31 PM by asadouglass

    HornetQ getting stuck while sending large number of messages

    srimanta.maji

      Please suggest me a way out for this problem.

       

      I am sending thousand of messages very fastly in mutiple thread .After sending 5000 to 6000 messages ,my server application just gets stuck sending further message.

      I am attaching code block and the statck trace below

       

      TaskAllcator" daemon prio=6 tid=0x033d0400 nid=0xbe4 waiting on condition [0x040cf000]

         java.lang.Thread.State: WAITING (parking)

          at sun.misc.Unsafe.park(Native Method)

          - parking to wait for  <0x1d6d00a8> (a java.util.concurrent.Semaphore$NonfairSync)

          at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)

          at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)

          at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969)

          at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281)

          at java.util.concurrent.Semaphore.acquire(Semaphore.java:441)

          at org.hornetq.core.client.impl.ClientProducerCreditsImpl.acquireCredits(ClientProducerCreditsImpl.java:67)

          at org.hornetq.core.client.impl.ClientProducerImpl.doSend(ClientProducerImpl.java:303)

          at org.hornetq.core.client.impl.ClientProducerImpl.send(ClientProducerImpl.java:139)

          at org.hornetq.jms.client.HornetQMessageProducer.doSend(HornetQMessageProducer.java:451)

          at org.hornetq.jms.client.HornetQMessageProducer.send(HornetQMessageProducer.java:199)

          at org.hornetq.jms.client.HornetQMessageProducer.publish(HornetQMessageProducer.java:258)

          at com.globalids.server.MessageUtil.sendInformation(MessageUtil.java:329)

       

      public void sendInformation(Serializable message) throws NamingException, JMSException {

              InitialContext iniCtx = new InitialContext();

              if (topicConn == null) {

                  TopicConnectionFactory tcf = (TopicConnectionFactory) iniCtx.lookup(CONNECTION_FACTORY);

                  topicConn = tcf.createTopicConnection();

                  topicSession = topicConn.createTopicSession(false, TopicSession.CLIENT_ACKNOWLEDGE);

                  topicConn.start();

              }

              Topic publicTopic = (Topic) iniCtx.lookup("topic/" + getServerInfoTopicBindName());

              TopicPublisher send = topicSession.createPublisher(publicTopic);

              ObjectMessage tm = topicSession.createObjectMessage();

              tm.setObject(message);

              send.publish(tm);

              send.close();

          }