Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Messenger][AMQP] Automatically reconnect on connection loss#53892
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpReceiver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas approved these changesFeb 14, 2024
d5b946d
toae95410
Compareae95410
to056b4a5
Compareci failures unrelated |
fabpot approved these changesFeb 23, 2024
Thank you@ostrolucky. |
Merged
nicolas-grekas added a commit that referenced this pull requestJan 17, 2025
…nPillevesse)This PR was merged into the 7.1 branch.Discussion----------[Messenger] [AMQP] Improve AMQP connection issues| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | yes| New feature? | no| Deprecations? | no| License | MITAppy thisfix#53892 for :- `ack` (https://github.com/php-amqp/php-amqp/blob/latest/stubs/AMQPQueue.php#L50)- `nack` (https://github.com/php-amqp/php-amqp/blob/latest/stubs/AMQPQueue.php#L238)Because `\AMQPConnectionException` can also happen hereCommits-------5356023 improve amqp connection issues
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
When using Rabbitmq in cluster, there is a common need of having to upgrade the nodes, while keeping the existing connections. The way this is normally done is by putting nodes in cluster to
maintenance mode
, ensuring cluster is healthy at all times. However, symfony/messenger nor php-amqp handle this use case at the moment. What happens instead is that exception when getting the message is thrown, worker crashes, error is logged and process manager has to respin it. This all happens without having a way in user space to handle this case better. Messenger's retry mechanism does not work here, because that one kicks in only when exception is thrown in handlers. Concrete exception is following:What I'm proposing in this PR is that if connection error is detectedtry to reconnect once before throwing exception. That should handle the outlined case. This goes line in line with recommendation from AWS's support we got:
I've also reported issue atphp-amqplib/php-amqplib#1161 with hope that this could be fixed at some point upstream, but I don't give it a big chance.