[rabbitmq-discuss] Multithreading and rabbitmq-c

Arun Chandrasekaran visionofarun at gmail.com
Fri Feb 10 19:00:31 GMT 2012


Hi all,

With rabbitmq-c, it is possible to bind on different channels from 
different threads?

Basically, I'm not sharing any of these between the threads: 
amqp_connection_state_t, socket, channel.

Here is the "examples/amqp_consumer.c" sample code modified for 2 threads: 
http://codepad.org/zPa91lbr. I have also attached the code for your 
reference.

I get this error from the second thread : 

"Declaring queue: server connection error 504, message: CHANNEL_ERROR - 
expected 'channel.open'"

The README clearly states that it is valid to have different connections, 
sockets and channels per thread (last section): 
http://hg.rabbitmq.com/rabbitmq-c/file/fb6fca832fd2/README

Can someone give me an insight into where I am going wrong or if it is a 
limitation with rabbitmq-c?

Cheers,
Arun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120210/ba8a09b8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amqp_consumer.c
Type: text/x-csrc
Size: 5880 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120210/ba8a09b8/attachment.c>


More information about the rabbitmq-discuss mailing list