You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Patrick Vansevenant <pa...@tvh.com> on 2016/12/03 22:12:45 UTC

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

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 some tests 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 queuePrefetch becomes two 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 two messages what should maximum be one with a defined
queuePrefetch of one.

Is it possible that the queuePrefetch doesn't work reliable in ActiveMQ
5.14.1 with an AMQP client ?

Patrick

-- 


**** DISCLAIMER ****

http://www.tvh.com/glob/en/email-disclaimer

"This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message."

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

Posted by Timothy Bish <ta...@gmail.com>.
On 12/08/2016 07:24 AM, Patrick Vansevenant wrote:
> Great idea ! But I don't experience any improvement with a
> usePrefetchExtension set to "false".
> I don't know of the broker destination policy settings in general work
> together with an AMQP client ?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/A-configured-queuePrefetch-of-one-in-ActiveMQ-5-14-1-with-AMQP-1-0-behaves-like-a-queuePrefetch-of-t-tp4719736p4719948.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

The prefetchExtension does not apply to AMQP clients, the client 
controls the available link credit which in this case is configured to 
be maintained as 1.


-- 
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/


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

Posted by Patrick Vansevenant <pa...@tvh.com>.
Great idea ! But I don't experience any improvement with a
usePrefetchExtension set to "false". 
I don't know of the broker destination policy settings in general work
together with an AMQP client ?



--
View this message in context: http://activemq.2283324.n4.nabble.com/A-configured-queuePrefetch-of-one-in-ActiveMQ-5-14-1-with-AMQP-1-0-behaves-like-a-queuePrefetch-of-t-tp4719736p4719948.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

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

Posted by lichtin <li...@yahoo.com>.
What about setting the usePrefetchExtension policy to "false"?
Then the broker will wait for the consumer to acknowledge that the message
is processed before refilling the prefetch buffer.


tabish121@gmail.com wrote
> On 12/07/2016 05:09 PM, Patrick Vansevenant wrote:
>> I have opened JIRA https://issues.apache.org/jira/browse/AMQ-6530.
>>
>> I will certainly try ActiveMQ 5.14.2 at the moment it is released !
>>
>>
> 
> Reviewed the test case, current behavior is correct, if you want single 
> message dispatch then you'd need to use prefetch of zero.
> 
> 
> -- 
> Tim Bish
> twitter: @tabish121
> blog: http://timbish.blogspot.com/





--
View this message in context: http://activemq.2283324.n4.nabble.com/A-configured-queuePrefetch-of-one-in-ActiveMQ-5-14-1-with-AMQP-1-0-behaves-like-a-queuePrefetch-of-t-tp4719736p4719938.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

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

Posted by Timothy Bish <ta...@gmail.com>.
On 12/07/2016 05:09 PM, Patrick Vansevenant wrote:
> I have opened JIRA https://issues.apache.org/jira/browse/AMQ-6530.
>
> I will certainly try ActiveMQ 5.14.2 at the moment it is released !
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/A-configured-queuePrefetch-of-one-in-ActiveMQ-5-14-1-with-AMQP-1-0-behaves-like-a-queuePrefetch-of-t-tp4719736p4719922.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reviewed the test case, current behavior is correct, if you want single 
message dispatch then you'd need to use prefetch of zero.


-- 
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/


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

Posted by Patrick Vansevenant <pa...@tvh.com>.
I have opened JIRA https://issues.apache.org/jira/browse/AMQ-6530.

I will certainly try ActiveMQ 5.14.2 at the moment it is released !




--
View this message in context: http://activemq.2283324.n4.nabble.com/A-configured-queuePrefetch-of-one-in-ActiveMQ-5-14-1-with-AMQP-1-0-behaves-like-a-queuePrefetch-of-t-tp4719736p4719922.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

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

Posted by Timothy Bish <ta...@gmail.com>.
On 12/06/2016 03:58 PM, Patrick Vansevenant wrote:
> Your explanation is very valuable and completely correct in my opinion.
>
> Nevertheless there are some differences concerning the queuePrefetch between
> version 5.14.1 and 5.13.3.
>
> The Dispatched Queue contains maximum one message in 5.13.3 with a
> queuePrefetch of one and that at any point in time.
>
> I have a unit test ready which indicate the difference. I can create a Jira
> issue and share my unit test if you wish ?
>
> Patrick
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/A-configured-queuePrefetch-of-one-in-ActiveMQ-5-14-1-with-AMQP-1-0-behaves-like-a-queuePrefetch-of-t-tp4719736p4719820.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

You are welcome to open a JIRA although I'd caution that the AMQP 
protocol support has been in ongoing development for several versions 
now and so between major releases you will likely see changes to 
behaviors here and there.  I'd recommend trying with the upcoming 5.14.2 
release which does have some fixes to the AMQP credit handling that may 
or may not be related.


-- 
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/


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

Posted by Patrick Vansevenant <pa...@tvh.com>.
Your explanation is very valuable and completely correct in my opinion.

Nevertheless there are some differences concerning the queuePrefetch between
version 5.14.1 and 5.13.3.

The Dispatched Queue contains maximum one message in 5.13.3 with a
queuePrefetch of one and that at any point in time.

I have a unit test ready which indicate the difference. I can create a Jira
issue and share my unit test if you wish ?

Patrick



--
View this message in context: http://activemq.2283324.n4.nabble.com/A-configured-queuePrefetch-of-one-in-ActiveMQ-5-14-1-with-AMQP-1-0-behaves-like-a-queuePrefetch-of-t-tp4719736p4719820.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

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

Posted by Timothy Bish <ta...@gmail.com>.
Sounds like it is working as intended if I understand the usage you are 
saying is happening.  The client will refill the link credit in this 
case every time a message is either read via (receive, receiver(timed) 
or receiveNoWait) or when a message is handed off to an async consumer.  
This happens because you've asked for a *prefetch* of one so the client 
is instructing the broker to do just that.  If you want only one message 
to be dispatched to the client at a time then you want prefetch of zero 
and then use the receive methods to pull a message from the broker on 
demand.

On 12/03/2016 05:12 PM, Patrick Vansevenant wrote:
> 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 some tests 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 queuePrefetch becomes two 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 two messages what should maximum be one with a defined
> queuePrefetch of one.
>
> Is it possible that the queuePrefetch doesn't work reliable in ActiveMQ
> 5.14.1 with an AMQP client ?
>
> Patrick
>


-- 
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/