Channel.wait_for_confirms giving Timeout::Error

33 views
Skip to first unread message

jagadesh devalla

unread,
Nov 15, 2018, 6:39:12 AM11/15/18
to Ruby RabbitMQ libraries
Hi,

I'm trying t implement publisher confirms in my Rails application. I'm using channel#wait_for_confirms method.

I'm creating per message one connection and closing it at end of message publishing code.

It's working as expected in  local, dev and stage environments but causing error in production environment.

The production app hosted in AWS and Rabbitmq is load balanced.

The bunny version is 2.9.2.

If anybody faced and fixed similar error please help.

Thanks



Screen Shot 2018-11-14 at 5.49.57 PM.png

Michael Klishin

unread,
Nov 15, 2018, 6:45:12 AM11/15/18
to Ruby RabbitMQ libraries
Please post full stack traces as text (e.g. a GitHub gist) in the future.

The function you are using can time out (it has a timeout argument). Timeouts are a fact of life in distributed
systems, in particular in public clouds. Your application has to handle them. A timeout should be treated as a publishing failure
in this case.

And please don't open a new connection per message. That's incredibly inefficient and not how Bunny or RabbitMQ are meant to be used.
Connections are meant to be long lived (possibly pooled), this has been discussed many times before on this list.
Reply all
Reply to author
Forward
0 new messages