[
https://issues.apache.org/jira/browse/AMQ-4827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13810381#comment-13810381
]
Benjamin Truitt commented on AMQ-4827:
--------------------------------------
Hi Timothy - thanks for your response. I am a colleague of Yung's so I'll jump
in.
We have tried setting prefetch size to 0 as you suggest, and yes that does
solve the issue. However, performance degrades to an unacceptable degree when
we reduce prefetch size to 0 (from 1). A few more facts, in case they are
useful:
* We use transacted routes
* We are using durable queues
* We use caching consumers for performance reasons
* We use prefetch = 1 for performance reasons...we found no significant
improvement for values greater than 1, but when set to 0, performance is much
worse.
We did read in the ActiveMQ documentation
(http://activemq.apache.org/what-is-the-prefetch-limit-for.html) that pooled /
cached consumers should not use prefetch greater than 0 for exactly the reason
we are reporting here.
So to clarify this purpose of this bug report, we aren't really asking why this
is happening, but whether there is some additional setting we can use to
prevent messages from being stuck, while preserving the high performance we get
from cached consumers + prefetch.
For example, ActiveMQ 5.9 introduces AbortSlowAckConsumerStrategy
(http://java.dzone.com/articles/coming-activemq-59-new-way). I believe this is
probably the solution to this "bug" report. Does that seem right to you? If
so, we'd like to humbly suggest updating the documentation about prefetch with
pooled consumers
(http://activemq.apache.org/what-is-the-prefetch-limit-for.html) to note that
this can be used to prevent stuck messages. If it won't work, can you please
help us understand why not?
Thanks in advance for your help!
> Set jms.queuePrefetch=1 Causes Messages To Be Stuck in Queue
> ------------------------------------------------------------
>
> Key: AMQ-4827
> URL: https://issues.apache.org/jira/browse/AMQ-4827
> Project: ActiveMQ
> Issue Type: Bug
> Affects Versions: 5.7.0, 5.8.0
> Reporter: Yung Lai
>
> Configuration:
> connectionUri=tcp://localhost:61616?jms.prefetchPolicy.queuePrefetch=1&keepAlive=true
> activemq.conf is default with no changes
> Scenario:
> Sent 7 different messages to the same queue. With prefetch=1 about 1 or 2
> messages would get stuck in the queue everytime. After a restart of activemq
> the messages that were stuck in queue would be processed.
> With cachingConsumers=false the messages would not get stuck.
> We need cachingConsumers for better performance so setting it to false is not
> an option for us.
> Here is a thread that is very similar to the issue.
> http://activemq.2283324.n4.nabble.com/Messages-stuck-in-queue-td3244342.html
> Thank you for your time and consideration.
--
This message was sent by Atlassian JIRA
(v6.1#6144)