activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spam trap <>
Subject ActiveMQ-CPP consumer starting + stopping
Date Wed, 27 Feb 2013 10:20:08 GMT
[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

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.
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.

Before I start posting code, can anyone tell me if my method is
fundamentally correct or wrong and, if wrong, suggest a better way?

View raw message