Skip to content

Dselans/handle nil acknowledger #23

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

Merged
merged 2 commits into from
Jun 23, 2024
Merged

Conversation

dselans
Copy link
Contributor

@dselans dselans commented Jun 23, 2024

Rabbit library will now attempt to reconnect if it comes upon a msg with a nil Acknowledger on amqp.Delivery.

I am not sure how to reproduce this as it seems to occur when RabbitMQ is under duress and RabbitMQ's supervisor kills a child that is used for the connection.

Since reproducing this test case is complicated, I added a rabbit-force-reconnect header check in the reconnect logic. If this header is present, rabbit lib will reconnect.

Also, updated Publish() to accept optional headers.

dselans added 2 commits June 23, 2024 14:15
^ a message could have a nil Acknowledger if rabbitmq supervisor kills a
child process (due to overload, max memory usage, etc.).

Since it's difficult to test this scenario - we are triggering the same
reconnect logic if a `rabbit-force-reconnect` header is present as well.
@dselans dselans merged commit 97abf12 into main Jun 23, 2024
1 check passed
@dselans dselans deleted the dselans/handle-nil-acknowledger branch June 23, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant