Currently there is no way to handle when reconnection is failing, and there is no feedback for logs either for Splunk logging and so forth. Even this wouldn't really be enough on its own as without a handling mechanism, it's not possible to write metrics for these errors to enable alerting and so on.
I've carefully crafted this PR to allow for this extra handler, which can be hooked into by first creating a ConnectionPool via the new NewConnectionPoolWithUnhealthyHandler or NewConnectionPoolWithHandlers "constructors" and then passing this into the new NewRabbitServiceWithConnectionPool "constructor" for the rabbit service. This way, no existing underlying logic changes and there are no breaking API changes either.
Currently there is no way to handle when reconnection is failing, and there is no feedback for logs either for Splunk logging and so forth. Even this wouldn't really be enough on its own as without a handling mechanism, it's not possible to write metrics for these errors to enable alerting and so on.
I've carefully crafted this PR to allow for this extra handler, which can be hooked into by first creating a ConnectionPool via the new
NewConnectionPoolWithUnhealthyHandler
orNewConnectionPoolWithHandlers
"constructors" and then passing this into the newNewRabbitServiceWithConnectionPool
"constructor" for the rabbit service. This way, no existing underlying logic changes and there are no breaking API changes either.Simple example of the latter in action.