Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-786

Generic JMS connection pool does not reconnect after failure

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBoss A-MQ 6.2
    • JBoss A-MQ 6.1
    • None
    • None
    • Hide

      1. Unpack the attached /activemq_connection_test.zip to reveal a Maven project
      2. Start ActiveMQ or Fuse 6.1 on the same host to give a broker service on port 61616 (or modify the Java code to specify appropriate broker connection parameters)
      3. Run the test code: mvn install -Dtest=AMQPoolConnectionTest. You will see messages indicating that the code has attempted to consume a message
      4. Shut down then broker. You will see error messages indicating that connection has failed
      5. Restart the broker. Error messages will continue, and connection is not restored

      The exact behaviour of the test will depend on the exact moment at which the broker was shut down, and for how long. Sometimes there will be a partial recovery of connection, sometimes none at all.

      Show
      1. Unpack the attached /activemq_connection_test.zip to reveal a Maven project 2. Start ActiveMQ or Fuse 6.1 on the same host to give a broker service on port 61616 (or modify the Java code to specify appropriate broker connection parameters) 3. Run the test code: mvn install -Dtest=AMQPoolConnectionTest. You will see messages indicating that the code has attempted to consume a message 4. Shut down then broker. You will see error messages indicating that connection has failed 5. Restart the broker. Error messages will continue, and connection is not restored The exact behaviour of the test will depend on the exact moment at which the broker was shut down, and for how long. Sometimes there will be a partial recovery of connection, sometimes none at all.

    Description

      The ActiveMQ code contains a generic (i.e., not ActiveMQ-specific) connection pool, whose implementation is in org.org.apache.activemq.jms.pool. This pool can be used by (for example) Camel routes that communicate with message brokers other than Active MQ.However, this pool is unable to detect disconnections at the transport level. If the broker goes down and is restarted, the connections in the pool remain invalid, and this situation persists indefinitely. If the pool is fully populated, then it will never make a new connection to the broker. If it is partially populated, then eventually there may be a mixture of good and bad connections in the pool. Applications may receive a good or a bad connection.The ActiveMQ-specific pool in org.org.apache.activemq.pool has failure detection logic that handles connection failures by evicting failed connections from the pool. The Spring CachedConnectionFactory also handles connection failures, but by installing JMS exception listeners on the connection. The generic JMS pool, however, appears to use neither of these mechanisms, and cannot recover from connection failures.

      Attachments

        Activity

          People

            dejanbosanac Dejan Bosanac
            rhn-support-kboone Kevin Boone
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: