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

A configured queuePrefetch of one in ActiveMQ 5.14.1 with AMQP 1.0 behaves like a queuePrefetch of two.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 5.14.1
    • None
    • AMQP
    • None

    Description

      I'm talking about queues with a low message volume and high processing time. In such a setup is it important that messages are not "heaping up" in the dispatch queue. The queueprefetch must be one in order to keep it workable.

      I have done a test with an ActiveMQ 5.14.1 broker and an AMQP consumer with a brokerURL configured with a queuePrefetch of one (jms.prefetchPolicy.queuePrefetch=1).

      I have the impression that the Dispatched Queue contains two messages during the period that a message is received and the time the acknowledgement is sent (clientacknowlegde mode).

      The consumer details in the ActiveMQ Web Console tells me that the "Dispatched Queue" contains indeed two messages at that moment in time what should maximum be one with a defined queuePrefetch of one.

      When I do the same test with an ActiveMQ 5.13.3 broker then the Dispatched Queue contains maximum one message at any point in time, what is more correct in my opinion.

      I have created a unit test that shows the difference between ActiveMQ 5.13.3 and 5.14.1. The test consists of two asynchronous consumers and one sender. When the first consumer receives a first message then the onMessage thread will block before the message is acked. The second consumer should consume all the other messages.

      The unit test sends four messages. With ActiveMQ 5.13.3 are all the four messages consumed (unit test passes). With ActiveMQ 5.14.1 are only three of the four messages consumed (unit test fails) because one of the messages stays in the Dispatched Queue.

      Please find below my unit test and the corresponding activemq config :

      Attachments

        1. activemq.xml
          7 kB
          Patrick Vansevenant
        2. JmsClientUnitTest.java
          5 kB
          Patrick Vansevenant
        3. 5.13.3 - queueprefetch of one - max dispatched queue is one.png
          9 kB
          Patrick Vansevenant
        4. 5.14.1 - queueprefetch of one - max dispatched queue is two.png
          9 kB
          Patrick Vansevenant

        Activity

          People

            Unassigned Unassigned
            patrickv Patrick Vansevenant
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: