I'm not really sure what you are asking.  The CountDownLatch is used
specifically in our example to control the consumer and make that it
doesn't wait forever for messages and it stops as soon as it gets all
the messages we told it to.  This happens when the run method in the
consumer class finishes waiting on the latch.

If you are trying to stop a consumer receiving then you can just close
the consumer and recreate it, or call stop on the connection and then
start it again when you are ready.

Regards
Tim.


On Fri, 2007-10-26 at 06:49 -0700, mrh wrote:
> In the activemq-cpp example code, there is a countdown "latch".  If I
> understand it correctly, you can pass in a number of milliseconds that it is
> to wait for a message or a number that it will count down to as messages are
> received.  With this structure, is it possible to asychronously receive
> messages (using the onMessage function to process them) but stop the
> listener from the outside? Say, from an outside thread?
> 
> Thanks,
> mrh

Reply via email to