Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-6156

ActiveMQConnection threads in parked state during startup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 5.11.1
    • None
    • Connector
    • None
    • Linux

    Description

      I've implemented a JMS producer using org.apache.activemq.ActiveMQConnectionFactory API. In the deployment they are 10 threads launched and each thread invokes the following sequence of methods which wrap around the ActiveMQConnection API.

      connector = new ActiveMQConnect();
      connector.setEndPointURL(primaryURL, secondaryURL, connectorQueryString);
      connector.setCredentials(userName, password);
      connector.initializeConnection();
      connector.setDestinationQueue(queueName);
      connector.addMessageToQueue(message);
      connector.sendMessageToQueue();

      The call to initializeConnection in turn invokes the following code which returns the connection

      1) ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(m_userName, m_password, m_endPointUrl);
      2) m_queueConnection = connectionFactory.createConnection();
      3) m_queueConnection.start();

      However, (and potentially under load), a large % of the threads enter the parked state and stay there. The stack trace for these threads is as follows:

      java.lang.Thread.State: WAITING
      at sun.misc.Unsafe.park(Native Method)
      at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1841)
      at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:341)
      at org.apache.activemq.transport.FutureResponse.getResult(FutureResponse.java:40)
      at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:80)
      at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1195)
      at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1289)
      at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:456)
      at ActiveMQConnect.initializeConnection(ActiveMQConnect.java:63)

      The JMS producer connects using failover transport to an active/passive or primary/failover configuration.

      Is the problem being caused by the failover URL? The documentation seemed to indicate that the failover URL can be sent with format:

      failover:(tcp://amq01:61616,tcp://amq02:61616)?queryString....

      Would appreciate any advice so I can resolve this issue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gelawlor Ger Lawlor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: