Skip to content
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

AutomaticRecovery from RabbitMQ Connection Factory doesn't recover from everything #4384

Merged
merged 5 commits into from Oct 8, 2020

Conversation

JSchoreels
Copy link
Contributor

Hi,

We met a condition in production where the Connection Factory of Rabbitmq won't recover (when isAutomaticRecoveryEnabled is set to true). It's easily reproducible by calling the ".close()" method on it.
It's explained here : https://www.rabbitmq.com/api-guide.html#recovery

The current code would always returns the same connection, not re-establishing it, if isAutomaticRecoveryEnabled is enabled.

Our solution, based on the fact we just have "isOpen" to check the state of the channel/connection was to re-establish the connection in the RabbitMQConsumer even if "isAutomaticRecoveryEnabled" is enabled.

What's your thought about it ?

…om everything and we could just return the same closed connection over and over ...
…) again, my solution would be to stop it before
…n, we have to reconnect to it before publishing our response to it, since the current Reconnection mechanism is made only in Producer, not in Publisher
… from the messages during the conversion to AMQP properties. Thus, I use a temporar Map to keep the logic as close as it is, but without touching the Message Headers
@JSchoreels
Copy link
Contributor Author

I added few others improvements we made, specially when the Consumer receives a RPC Call, he can't send it back if the channel is down ... So we added a little mechanism to reconnect the channel one time before retrying to send back the reply. It allowed us to not lose any RPC call in case of connection/channel outage.

@bedlaj
Copy link
Contributor

bedlaj commented Oct 7, 2020

Thanks for contribution. Can you please revert all unnecessary changes? You have reordered methods and fields in RabbitConsumer and because of that is your PR much harder to review then it could be.

@JSchoreels
Copy link
Contributor Author

JSchoreels commented Oct 7, 2020 via email

@JSchoreels
Copy link
Contributor Author

I pushed a new commit which revert all the format changes, "Files changed" looks normal now

@davsclaus davsclaus merged commit d364875 into apache:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants