<div dir="ltr">I suppose i can do "String consumerTag = channel.queueDeclarePassive(strQueueName).getConsumerTag();"</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 12, 2014 at 12:20 PM, cw storm <span dir="ltr"><<a href="mailto:cwstorm@gmail.com" target="_blank">cwstorm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Simon and team,<div><br></div><div>Besides the number of active queue consumer, can I get the actual name or value that's in the consumer tag?</div>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Feb 12, 2014 at 10:48 AM, cw storm <span dir="ltr"><<a href="mailto:cwstorm@gmail.com" target="_blank">cwstorm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks guys. The "int consumers = channel.queueDeclarePassive(strQueueName).getConsumerCount();" will meet my requirement. In my service, I will check to see if that number is greater than 0 or not. If not, then issue "basicConsume". But if my other server need to also register the queue consumer as well, then maybe I need to check if the number equals 2 instead.<div>
<br></div><div>I'm just wondering if you have two servers, do you have both of your server create a queue consumer to the queue?</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Feb 12, 2014 at 10:14 AM, cw storm <span dir="ltr"><<a href="mailto:cwstorm@gmail.com" target="_blank">cwstorm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks guys.<div><br></div><div>If I declare the queue exclusive, then my other server won't be able to register the queue consumer right? We have two ESB servers for load balancing. That means, two queue consumer for that queue. However, if someone accidentally execute the service, then it'll create a new channel/connection and queue consumer for that queue. That I don't want to happen.</div>
</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 12, 2014 at 10:04 AM, Alvaro Videla <span dir="ltr"><<a href="mailto:videlalvaro@gmail.com" target="_blank">videlalvaro@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
If you need to have just one consumer per queue, then declare the<br>
queue as exclusive.<br>
<br>
If you want to check if there are consumers attached to a particular<br>
queue, then inspect the return values of issuing a passive<br>
queueDeclare.<br>
<br>
Regards,<br>
<br>
Alvaro<br>
<div><div><br>
On Wed, Feb 12, 2014 at 3:59 PM, cw storm <<a href="mailto:cwstorm@gmail.com" target="_blank">cwstorm@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I have a situation where someone executed the service that calls the<br>
> "basicConsume" which basically assigns a queue consumer to that queue on a<br>
> different channel. This cause multiple queue consumer for that queue. Is<br>
> there someway in that service where I can check to see if an existing queue<br>
> consumer already exist for that queue before issue'ing the "basicConsume"?<br>
><br>
</div></div><div><div>> _______________________________________________<br>
> rabbitmq-discuss mailing list<br>
> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
> <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
><br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>