On 02/27/2013 05:20 AM, spam trap wrote:
[ActiveMQ-CPP v3.4.4]
I have an ActiveMQ asynchronous consumer that I need to start and stop
consuming. I also need it to redeliver messages that it has
previously consumer but not acknowledged. To do this I am using the
INDIVIDUAL_ACKNOWLEDGE mode.
To start and stop the consumer I am using session.recover() and
session.stop() methods respectively.
Another requirement is that the consumer needs to be created in a
'stopped' state so that no messages are consumed until it is
explicitly enabled.
I have two problems:
1. Even though I call session.stop() after creating the session for
the consumer, it does consume messages when I start the connection and
set the message listener.
Starting a Connection starts all sessions it created implicitly.
2. After calling session.stop() and session.recover() more than twice
the unacknowledged message is no longer delivered to the consumer. I
can see it is still there. If I restart the consumer completely then
the message is delivered again.
You can add more tests to the integration tests suite to demonstrate
when issue you think you are running into.
Before I start posting code, can anyone tell me if my method is
fundamentally correct or wrong and, if wrong, suggest a better way?
Thanks.
--
Tim Bish
Sr Software Engineer | RedHat Inc.
[email protected] | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/