activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Vittecoq <sylvain.vitte...@byteactive.com>
Subject How to disable consumption from one queue "temporarily" ?
Date Thu, 31 Mar 2011 09:06:05 GMT

Hello all,

We are using ActiveMQ 5.4.2 with the activemq-cpp library 3.2.4.

Our topology is the following :

    * A set of Linux processes (consuming and producing messages) are
      connected to a Broker A.
    * Another set of Linux processes (consuming and producing messages)
      are connected to a Broker B.
    * Broker A and Broker B are connected to each other.


We have activated the producer flow control on all queues (we do not use 
topics at this point) and all our messages are non-persistent messages.
I believe this is the only deviance from the default configuration.

My question is the following :
Each process may consume messages from different queues.
What is the "best" way for such consumer to indicate that it does not 
want to receive any new message from a specific queue ?
(But this consumer must keep receiving messages posted on its other queues).


One solution seems to clear the MessageListener for this specific Consumer :
/getConsumer()->*setMessageListener*(NULL);
/
to not receive any message and then later on set again the 
MessageListener when the processing can resume for this queue inside 
this process:
/getConsummer()->*setMessageListener*(this);
/
However in our environment it seems that the /*setMessageListener() 
API*/ must be executed by a thread which can NOT be the ActiveMQ thread 
calling the onMessage callback function.
So is there an easier solution which does not require this extra 
application thread ?


Thank you very much for your help,

Sylvain


-- 
Sylvain Vittecoq
Cell : +46 (0) 7 67 77 76 10
SkypeId: sylvainvittecoq
Web: http://www.byteactive.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message