You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Pablo La Greca (JIRA)" <ji...@apache.org> on 2011/09/07 04:39:09 UTC
[jira] [Created] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
----------------------------------------------------------------------------------------------------------------------------------------------------------
Key: AMQ-3485
URL: https://issues.apache.org/jira/browse/AMQ-3485
Project: ActiveMQ
Issue Type: Bug
Components: JMS client
Affects Versions: 5.5.0
Reporter: Pablo La Greca
When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
i.e:
Session session = .... //transacted session
Destination dest = ....
MessageConsumer mc = session.createMessageConsumer(dest);
Message message = mc.receive(); // message received ok
mc.close();
mc = session.createMessageConsumer(dest);
Message message = mc.receive(); // message is null
Thanks, Pablo.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Pablo La Greca (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pablo La Greca updated AMQ-3485:
--------------------------------
Comment: was deleted
(was: Dejan thanks!. Somebody with common sense finally.)
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Assignee: Dejan Bosanac
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Pablo La Greca (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099586#comment-13099586 ]
Pablo La Greca commented on AMQ-3485:
-------------------------------------
Attached you can found a maven project with a test reproducing this issue. It seems to be working in 5.2.0 and failing after that release.
Thanks, Pablo.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Pablo La Greca (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108811#comment-13108811 ]
Pablo La Greca commented on AMQ-3485:
-------------------------------------
I'm don't want that. What I want is that if I have a queue QUEUEA with 2 messages, and I have a session SESSIONA, I should be able to create one consumer with SESSIONA and consume the first message, close that consumer, and then create another consumer with SESSIONA and consume the second message. Once more, as I was able to do in previous versions of ActiveMQ.
If after that I commit SESSIONA both message will be removed.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Pablo La Greca (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13481353#comment-13481353 ]
Pablo La Greca commented on AMQ-3485:
-------------------------------------
Dejan thanks!. Somebody with common sense finally.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Assignee: Dejan Bosanac
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482369#comment-13482369 ]
Gary Tully commented on AMQ-3485:
---------------------------------
or you can set the prefetch on the broker via a destinationPolicy to set the prefetch for all or a matching set, of destinations.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Assignee: Dejan Bosanac
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098940#comment-13098940 ]
Timothy Bish commented on AMQ-3485:
-----------------------------------
I'd recommend creating a JUnit test case that reproduces your issue and attaching it here.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dejan Bosanac reopened AMQ-3485:
--------------------------------
Assignee: Dejan Bosanac
It looks like a bug. The expectation that you can close and open new consumers in the same transaction and receive messages is valid.
I'll play with the test a bit to see if I can find the problem.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Assignee: Dejan Bosanac
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Pablo La Greca (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pablo La Greca updated AMQ-3485:
--------------------------------
Attachment: activemq-issue-test-case.zip
App showing bug
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Sergio Bossa (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480278#comment-13480278 ]
Sergio Bossa commented on AMQ-3485:
-----------------------------------
I agree with you obviously.
I'm just saying if that's the case, it shouldn't fail silently by the way.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Pablo La Greca (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480246#comment-13480246 ]
Pablo La Greca commented on AMQ-3485:
-------------------------------------
I disagree. Message ordering processing should only be preserved if I'm using only one consumer.
It's ok to not preserve order if I decide to have more than one consumer. And I should also be able to have more than one consumer from the same QUEUE at the same time.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Pablo La Greca (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482339#comment-13482339 ]
Pablo La Greca commented on AMQ-3485:
-------------------------------------
To be honest it's not a solution for me. The thing is that I have a generic layer on top of activemq that I can't specialize for a particular case.
I don't need this fix right now but would be nice to have it fix in a future release.
Thanks Dejan.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Assignee: Dejan Bosanac
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Pablo La Greca (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13106710#comment-13106710 ]
Pablo La Greca commented on AMQ-3485:
-------------------------------------
Thanks Timothy. But I really don't understand.
If the session is not close, why I'm not able to create one consumer, close it, and then create another. And in the end commit()/rollback() the session?. This should be allowed as it is in previous ActiveMQ releases.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (AMQ-3485) Transacted Session returns
invalid MessageConsumer after the first MessageConsumer for the same
destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482288#comment-13482288 ]
Dejan Bosanac edited comment on AMQ-3485 at 10/23/12 12:34 PM:
---------------------------------------------------------------
So we investigated this in more details. The problem was introduced with a fix for [AMQ-2034], when we started postponing the closing of the actual consumer until transaction ends (either commit or rollback). This leads us to the problem where the messages that were already prefetched by the consumer are stuck on that consumer until the end of the transaction.
The easiest workaround for this is to turn of prefetching, with something like
{code}Destination dest = session.createQueue("TEST?consumer.prefetchSize=0");{code}
And frankly turning of the prefetch in use cases where you want to have multiple consumers coming and going inside the single transaction make the only sense, as every other approach will mess the order of messages.
To support closing consumers with prefetched messages inside the transaction we'd need to refactor the whole thing. Ideally the consumer would close immediately and on transaction end, broker would know how to redeliver unconsumed messages.
Let me know if this workaround works for you.
was (Author: dejanb):
So we investigated this in more details. The problem was introduced with a fix for [AMQ-2034], when we started postponing the closing of the actual consumer until transaction ends (either commit or rollback). This leads us to the problem where the messages that were already prefetched by the consumer be stuck on that consumer until the end of the transaction.
The easiest workaround for this is to turn of prefetching, with something like
{code}Destination dest = session.createQueue("TEST?consumer.prefetchSize=0");{code}
And frankly turning of the prefetch in use cases where you want to have multiple consumers coming and going inside the single transaction make the only sense, as every other approach will mess the order of messages.
To support closing consumers with prefetched messages inside the transaction we'd need to refactor the whole thing. Ideally the consumer would close immediately and on transaction end, broker would know how to redeliver unconsumed messages.
Let me know if this workaround works for you.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Assignee: Dejan Bosanac
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482288#comment-13482288 ]
Dejan Bosanac commented on AMQ-3485:
------------------------------------
So we investigated this in more details. The problem was introduced with a fix for [AMQ-2034], when we started postponing the closing of the actual consumer until transaction ends (either commit or rollback). This leads us to the problem where the messages that were already prefetched by the consumer be stuck on that consumer until the end of the transaction.
The easiest workaround for this is to turn of prefetching, with something like
{code}Destination dest = session.createQueue("TEST?consumer.prefetchSize=0");{code}
And frankly turning of the prefetch in use cases where you want to have multiple consumers coming and going inside the single transaction make the only sense, as every other approach will mess the order of messages.
To support closing consumers with prefetched messages inside the transaction we'd need to refactor the whole thing. Ideally the consumer would close immediately and on transaction end, broker would know how to redeliver unconsumed messages.
Let me know if this workaround works for you.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Assignee: Dejan Bosanac
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Sergio Bossa (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480132#comment-13480132 ]
Sergio Bossa commented on AMQ-3485:
-----------------------------------
The problem is not about consuming from *multiple consumers* the *same* message: it is about consuming *different messages*.
That is, subsequent consumers always return null if there's a previous consumer with a non committed message, which doesn't make sense, as if you want to preserve ordering with that, you should really throw an exception rather than fail silently.
Is it clearer now?
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Timothy Bish closed AMQ-3485.
-----------------------------
Resolution: Not A Problem
Working as designed. The second consumer would not receive the message as the session has not been rolled back, called rollback after consumer.close() and your second consumer would receive the message.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482347#comment-13482347 ]
Dejan Bosanac commented on AMQ-3485:
------------------------------------
Thanks for the comment Pablo. We'll try to make a fix. The thing is, it's not that trivial and will affect how we process transactions, so it requires some work.
As for the workaround, you just need to change a destination name when creating a consumer, so it should be easy one. But again, it might be impossible to do in your system.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Assignee: Dejan Bosanac
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AMQ-3485) Transacted Session returns invalid
MessageConsumer after the first MessageConsumer for the same destiantion.
Bug introduced in 5.5.0 - working ok in 4.1.2
Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AMQ-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13106714#comment-13106714 ]
Timothy Bish commented on AMQ-3485:
-----------------------------------
You can create as many consumers as you'd like but they won't consumer messages that have already been consumed in that transaction, you need to first rollback the transaction before a message will be redelivered.
> Transacted Session returns invalid MessageConsumer after the first MessageConsumer for the same destiantion. Bug introduced in 5.5.0 - working ok in 4.1.2
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3485
> URL: https://issues.apache.org/jira/browse/AMQ-3485
> Project: ActiveMQ
> Issue Type: Bug
> Components: JMS client
> Affects Versions: 5.5.0
> Reporter: Pablo La Greca
> Attachments: activemq-issue-test-case.zip
>
>
> When I have a transacted Session, as it is single threaded I can't create two MessageConsumer to the same Destination. But if I create a MessageConsumer to a Destination and then I close it, then I should be able to create a new MessageConsumer to the same Destination. This is working fine in active mq 4.1.2 but it doesn't work in 5.5.0. It allows to create a second MessageConsumer but that seconde MessageConsumer always returns null when the queue has messages.
> i.e:
> Session session = .... //transacted session
> Destination dest = ....
> MessageConsumer mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message received ok
> mc.close();
> mc = session.createMessageConsumer(dest);
> Message message = mc.receive(); // message is null
> Thanks, Pablo.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira