wagslane / go-rabbitmq

A wrapper of streadway/amqp that provides reconnection logic and sane defaults
https://blog.boot.dev/golang/connecting-to-rabbitmq-in-golang-easy/
MIT License
772 stars 126 forks source link

Notify is connection closed #74

Closed kotyara85 closed 1 year ago

kotyara85 commented 2 years ago

Is there a way to notify my app is rmq connection was closed? This's super important in different cases like change app status to unhealthy Thanks

wagslane commented 1 year ago

I like this idea if someone wants to implement it.

LucaWolf commented 1 year ago

The way I've implemented this in a rip-off spin-off project is via WithConnectionOptionNotification/WithChannelOptionNotification that set private "var notifier chan Event" then push various Events when needed. See notifications.go ->raiseEvent of https://github.com/LucaWolf/grabbit There are also some callbacks on the same idea.