[rabbitmq-discuss] SimpleAmqpClient Channel usage
alan.antonuk at gmail.com
Thu Mar 13 04:48:26 GMT 2014
If I understand your scenario correctly: you want to create
consumers/queues/bindings, while blocking waiting for a message using
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
- 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).
- Use the timeout parameter on BasicConsumeMessage, and occasionally poll
for a new consumers and create the consumers/queues/bindings as necessary.
- Depending on how your application is setup there's probably a third way.
On Wed, Mar 12, 2014 at 11:19 AM, pkbasu <pk_basu at hotmail.com> wrote:
> here is the flow of my program -
> 1. Create a SimpleAmqpClient channel
> 2. Consumer1 comes and created queues and bindings.
> 3. BasicConsumeMessage is called on the channel, the one which consumes
> message for any open consumers
> 4. We are waiting now for any message to come in.
> 5. Consumer2 comes and tries to create queue and bindings.
> 6. Consumer2 hangs since the channel is busy in step 4
> How do I make this work? Creating a separate channel for creating queues
> bindings will not work since BasicConsumeMessage works only on consumers
> created by its own channel.
> Any help is greatly appreciated.
> View this message in context:
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss