You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Rob Davies (JIRA)" <ji...@apache.org> on 2009/09/09 15:52:12 UTC

[jira] Resolved: (AMQ-2159) One evicted message out of two is delivered to the consumer

     [ https://issues.apache.org/activemq/browse/AMQ-2159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies resolved AMQ-2159.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 5.3.0

Ran test case against 5.3 - works as expected

> One evicted message out of two is delivered to the consumer
> -----------------------------------------------------------
>
>                 Key: AMQ-2159
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2159
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.2.0
>         Environment: Windows Xp, Java 5, ActiveMQ 5.2
>            Reporter: Yannick
>            Assignee: Rob Davies
>             Fix For: 5.3.0
>
>         Attachments: testActiveMQ.zip
>
>
> A problem in message eviction seems to cause a strange behavior of message delivery. After a slow consumer consumed it's prefetched messages, it start receiving one message out of two that were produced. When stepping into the sources I noticed that one message evicted out of two is dispatched to the destination even if no message have been consumed during that time. The problem seems to be in the class 'TopicSubscription'. This is what I found:
> - When a message is discarded dequeueCounter is incremented. 
> - Then next time a message arrives it is evicted then dispatchMatched is called. 
> - Because dequeueCounter have been called without any message dispatched, isFull() return false. 
> - As a result it assumes there is an empty room in the prefetch and dispatch the message. 
> The following example show what I expect against what I get when I produce 100 messages with a unique ID then consume 10 message and output the message ID. Prefetch size is 5. and constantPendingMessageLimitStrategy limit="5"
> Expected:
> 0, 1, 2, 3, 4, 95, 96, 97, 98, 99
> What I really get
>  0, 1, 2, 3, 4, 5, 7, 9, 11, 13
> I made a test application and a unit test, I didn't found how to attach it to the issue.

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