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

Timothy Bish commented on AMQ-2565:
-----------------------------------

The test fails because the JMSTemplate creates a new consumer on each call to 
receive, and the fact that its inside a transaction when onMessage is called 
means that the consumers aren't closed until the transaction is committed.  
Since the consumers have their prefetch left at default settings the second 
message is sitting in the prefetch buffer of the consumer created by the first 
call to JMSTemplate receive.  Once the onMessage completes and the transaction 
is committed the second message is available for dispatch once again.  You can 
observe this by adding another call to the JMSTemplate send to Queue A, then 
you test condition will be met and the test will pass.

> Consumer skips messages in a queue when invoked from another queue
> ------------------------------------------------------------------
>
>                 Key: AMQ-2565
>                 URL: https://issues.apache.org/jira/browse/AMQ-2565
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: ActiveMQ 5.4-SNAPSHOT, Spring 2.5.6, JDK 1.6
>            Reporter: Dragisa Krsmanovic
>             Fix For: 5.6.0
>
>         Attachments: TransactedConcurrentConsumerTest.patch
>
>
> MessageListener that is triggered by a message in queue A reads messages from 
> queue B using JmsTemplate. Although there are more messages in queue B, it 
> can only read the first one. The bug was introduced in AMQ 5.3
> This is related to 
> [CAMEL-2305|https://issues.apache.org/activemq/browse/CAMEL-2305].

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to