<div dir="ltr"><div class="gmail_extra">If I understand your scenario correctly: you want to create consumers/queues/bindings, while blocking waiting for a message using BasicConsumeMessage().</div><div class="gmail_extra">
<br></div><div class="gmail_extra">Unfortunately SimpleAmqpClient and the rabbitmq-c library it wraps are single threaded, and don't support this use-case well. You have one of two options: </div><div class="gmail_extra">
<br></div><div class="gmail_extra">- Create a new SimpleAmqpClient Channel object for each consumer. (Note that a SimpleAmqpClient Channel object wraps an entire AMQP connection, and manages AMQP channels internally, yes this was a poorly named).</div>
<div class="gmail_extra">- Use the timeout parameter on BasicConsumeMessage, and occasionally poll for a new consumers and create the consumers/queues/bindings as necessary.</div><div class="gmail_extra">- Depending on how your application is setup there's probably a third way.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">-Alan</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">
On Wed, Mar 12, 2014 at 11:19 AM, pkbasu <span dir="ltr"><<a href="mailto:pk_basu@hotmail.com" target="_blank">pk_basu@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Greetings,<br>
<br>
here is the flow of my program -<br>
<br>
1. Create a SimpleAmqpClient channel<br>
2. Consumer1 comes and created queues and bindings.<br>
3. BasicConsumeMessage is called on the channel, the one which consumes<br>
message for any open consumers<br>
4. We are waiting now for any message to come in.<br>
5. Consumer2 comes and tries to create queue and bindings.<br>
6. Consumer2 hangs since the channel is busy in step 4<br>
<br>
How do I make this work? Creating a separate channel for creating queues and<br>
bindings will not work since BasicConsumeMessage works only on consumers<br>
created by its own channel.<br>
<br></blockquote><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Any help is greatly appreciated.<br>
<br>
Thanks.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://rabbitmq.1065348.n5.nabble.com/SimpleAmqpClient-Channel-usage-tp34067.html" target="_blank">http://rabbitmq.1065348.n5.nabble.com/SimpleAmqpClient-Channel-usage-tp34067.html</a><br>
Sent from the RabbitMQ mailing list archive at Nabble.com.<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>
</blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>