Closed Pitasi closed 4 years ago
I was probably doing something weird with channels, I basically rewrote my logic being inspired by this code: https://github.com/isayme/go-amqp-reconnect/blob/master/rabbitmq/rabbitmq.go and the error is gone.
Leaving this as a reference for the future :smile:
Hey there. Thanks for this library! I'm having troubles implementing reconnection when the broker can no longer be reached - it kinda works 50% of the times, the other 50% I have this panic:
What I'm doing is basically have a goroutine ranging over a
chan *amqp.Error
and every time it receives something it re-initializes the connection, call NotifyClose() on the same chan, then re-init channel, exchange, queues, etc.From the doc:
apparently the chan sometimes is closed even on non-normal shutdowns.