[ 
https://issues.apache.org/activemq/browse/AMQ-1961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46105#action_46105
 ] 

Aaron Pieper commented on AMQ-1961:
-----------------------------------

Thanks for your reply. Disabling prefetch for queues fixes the problem. Waiting 
a few seconds before closing each consumer works also.

So this works as designed then? If you close one consumer, open a second 
consumer and retrieve a message, the expected behavior is that the message 
should occasionally be permanently "locked" by the closed consumer?

> Creating two consumers one after the other causes problems dequeuing messages
> -----------------------------------------------------------------------------
>
>                 Key: AMQ-1961
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1961
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.1.0
>            Reporter: Aaron Pieper
>         Attachments: EnqueueDequeueBug.java
>
>
> I create a vm queue with ten messages. I then create a consumer, dequeue the 
> top message (message #1), and close that consumer. If I then create a second 
> consumer, and try to dequeue the top message (message #2), there is a small 
> chance that this will unexpectedly fail, and the request will time out. This 
> is one problem.
> After this happens, examining the queue with a queue browser shows message #2 
> still on the queue. However, subsequent attempts to dequeue this message will 
> always time out. Messages #3-10 will be in the same state; they will still be 
> in the queue, but they cannot be dequeued. This is a worse problem, as it 
> means that we can not reuse this queue.
> The problem arises more frequently as there are more consumers. With two or 
> three consumers, it comes up sporadically. With twenty or more consumers, it 
> happens almost 100% of the time. I've attached a test case which demonstrates 
> the bug consistenty.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to