Skip to content

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
@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