1
Gakho 2020-05-11 18:55:38 +08:00
断开了连接这种 err 在你的 go func 应该能取到的,不用其他库的话就自己做重试
|
2
zpfhbyx 2020-05-11 19:00:35 +08:00
你 rabbitmq 有开 heartbeat 么
|
3
mine21 OP 最后用这个单写了个 重试
amqp: func (*Connection) NotifyClose func (c *Connection) NotifyClose(receiver chan *Error) chan *Error NotifyClose registers a listener for close events either initiated by an error accompanying a connection.close method or by a normal shutdown. On normal shutdowns, the chan will be closed. To reconnect after a transport or protocol error, register a listener here and re-run your setup process. |