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

jms consumer may hang if jms.prefetchPolicy.all=0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.16.5
    • None
    • JMS client
    • None

    Description

       

      I have an activemq broker using jdbc datasource and client application using failover tcp connection with parameter jms.prefetchPolicy.all=0. If connection to database is not stable, client may hang indefinitely.

      This happens in this scenario:

      1. There is a jms connection using failover tcp transport. Session is using CLIENT_ACKNOWLEDGE.
      2. Jms consumer calls receive - it sends pull message request to the broker.
      3. broker sends message to the consumer.
      4. client application starts processing of the message.
      5. network failure, broker looses connection to the database.
      6. broker stops tcp transport.
      7. client application finish processing of the message, but jms consumer fails to acknowledge message because broker is not available.
      8. network restores, broker restarts tcp transport.
      9. jms consumer restores connection to the broker and sends pull message request.
      10. Broker sends the SAME message to the consumer because it was not acknowledged.
      11. ActiveMQMessageConsumer detects message as duplicate and DROPS it, writing "suppressing duplicate delivery on connection, poison acking: MessageDispatch" in the log.
      12. consumer continue to wait a message. It hangs forever.

       

      This issue happens when jms.prefetchPolicy.all=0 - when client pulls messages from the broker instead of the broker pushing them to the client.

      Attachments

        1. MqTest2.java
          1 kB
          Gordon

        Activity

          People

            Unassigned Unassigned
            ud1 Gordon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: