[rabbitmq-discuss] Can I acknowledge a message in a separate thread to that which received the message?

Emile Joubert emile at rabbitmq.com
Tue May 10 12:59:46 BST 2011


Hi Robert,

On 07/05/11 00:18, steffi2 wrote:
>
> Does anybody know if using the Java client I'm allowed to acknowledge a
> message on a different thread than which picked up the message?

Yes it is possible, but only if the threads use the same channel.

> More generally can I use a channel from a different thread?

Yes, but you will need to synchronise access to the channel appropriately.

> I think I read that you should not use a channel simulatenously across
> threads?

Indeed. Avoid this if possible. You risk introducing races and protocol 
framing errors.



-Emile


More information about the rabbitmq-discuss mailing list