-
Notifications
You must be signed in to change notification settings - Fork 1
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
Auto reconnect in case of connection loss #58
base: main
Are you sure you want to change the base?
Conversation
This will take me some time to review. Just a quick look, we may need an exponential backoff to retry connection. |
Of course, take your time! |
Here is an example here: https://github.com/rabbitmq/amqp091-go/blob/main/_examples/client/client.go |
f780078
to
8d16c62
Compare
8d16c62
to
3472e76
Compare
Hi @ghokun, I performed some refactoring, extracted client to a separate file and added a simple backoff strategy to reconnection logic. Thank you for the provided example, it helped a lot! |
3472e76
to
a72bef4
Compare
Automatically try to reconnect if connection is interrupted.
Note that if a queue name is not specified then all messages arrived during reconnecting will be lost.
If the queue name is set then messages will be store there and delivered after reconnection.