[rabbitmq-discuss] Broken Pipe in RabbitMQ ConnectionFactory.newConnection()

Michael Klishin michael at rabbitmq.com
Sun Sep 8 23:04:52 BST 2013


John M.:

> Actually I am opening and closing connections quite a lot (once every ~3 RPC requests on average). Is that bad and I'm supposed to pool them?

It is simply unnecessary and also really inefficient.

RabbitMQ's protocol assumes long lived connections.
I can imagine there are potential issues in connection shutdown code in some clients simply
because there typically is no good reason to constantly open and close them in "real world" code.

Consider using a long-lived connection first (one channel should be fine for RPC), and
if the issue does not go away, post a stack trace here.

Note that if you publish messages from multiple threads, each should use a separate channel
(connection sharing is fine). 

MK



-------------- 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/20130908/1e61f89c/attachment.pgp>


More information about the rabbitmq-discuss mailing list