Closed husainaloos closed 5 years ago
Recovery with this client is an application developer's responsibility, by design. See examples. You must open new channels on the new recovered connection (and yes, that's not how Java, .NET, Ruby clients go about recovery but it was a conscious design choice. The most popular client, Pika, does the same thing).
@husainaloos Try this extension with reconnect and cluster supported: https://github.com/sirius1024/go-amqp-reconnect
I know this issue has been hammered many times, but it seems that there are many different situation where re-connection could be an issue.
Consider this case:
and in my main
now if the connection goes down. Now if I reconnect by establishing a new connection, then all the channels will never be back up again since they are using the old connection. Is there a way to reconnect while having the channels work again? It appears that
Connection
would need to keep track of the channels it creates and somehow notify theChannel
struct of any changes. Is there a way to avoid this situation?