Running into a timeout when publishing messages from Ruby on Rails #692
GuilhermeTrivilin
started this conversation in
General
Replies: 1 comment 1 reply
-
@GuilhermeTrivilin filing issues with questions in repositories that have Discussions enabled in 2024 is just rude. Start with inspecting server logs. Your code has all three most common beginner mistakes:
I'm not sure that channel&.close is syntactically valid Ruby. In general, this kind of code can quickly beyond the default maximum channel limit, after which the connection will be closed |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm facing a timeout issue when attempting to publish messages to a RabbitMQ queue in my Ruby on Rails application. I'm using the Bunny gem for connection and message publishing. The connection to RabbitMQ is successfully established, but when I try to publish a message, it times out. Interestingly, running the same publishing code directly through Rails Console works perfectly.
Here’s the setup for my connection initializer:
And here is the service responsible for publishing messages:
Environment Details: Ruby version: 2.5.6 Rails version: 5.2 Bunny gem version: 2.19 Troubleshooting Steps Taken: Verified that the connection works, as I can successfully connect. Tested publishing through Rails Console, which works as expected without timeouts. Additional Context: The timeout occurs only when publishing within the Rails application itself. I suspect it might be related to how the Bunny connection is being handled in production vs. Rails Console.
Any insights or solutions from those who have encountered similar issues would be highly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions