[rabbitmq-discuss] forking and getting or consuming messages

Michael Klishin mklishin at gopivotal.com
Fri Jul 26 06:35:58 BST 2013


> The second problem is that once all the messages are off the stack, the script exits. I'd like it to stay open and wait for more messages to come in. Is that possible using the queue->get() approach?

Child processes of fork(2) need to reopen all network connections
(not just to RabbitMQ).

So you need to pre-fork N workers and pass messages to them using
pipes or similar, or have each have a separate consumer. In the case of
pipes, coordinating acknowledgements may be pretty tricky, so using
one consumer per pre-forked worker is a much easier way.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130726/5a2e70ab/attachment.pgp>

More information about the rabbitmq-discuss mailing list