-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temp (response) queue won't be auto-deleted due to channel remains open #6
Comments
After some research I found out that On every sync request that rack-rabbit does, it creates temporary queue on RabbitMQ broker, and tells the broker to auto-destroy this queue right after the channel/connection to the broker will be closed. It's fine if you instantiate new TCP connection to RabbitMQ every time you make synchronous request. So connection opened, temp queue created, actual request sent to exchange, response received from temp queue, connection closed, broker auto-deleted temp queue due to connection closed event. Done. However, when you prefer to increase throughput and efficiency of your connection to RabbitMQ (in my case I've got 2x increase in throughput this way) and keep TCP connection open for further synchronous requests, that opened channel becomes a source of problems. By keeping channel open, RabbitMQ does not see any reason to auto-delete created temp queue, so the temp queue for every request made will stay alive permanently. Thus, RabbitMQ will keep created and used temp queues until it overflow at some point. To deal with this issue we need to manually delete temp queue right after we receive response from that queue. To fix this it needs to add rack-rabbit/lib/rack-rabbit/client.rb Line 65 in 0fc9fb8
Pull request will follow. |
…ynchronous requests. jakesgordon#6
Fix Issue #6. Added manual removal of temporary queue on synchronous req...
Am I right thinking that
RR::Client#request
rack-rabbit/lib/rack-rabbit/client.rb
Line 50 in 0fc9fb8
does not close channel after it received response?
So the temporary queue won't be auto-deleted, as the connection (channel) is still open.
The text was updated successfully, but these errors were encountered: