Closed achilleasa closed 9 months ago
This implementation looks reasonable and it's similar to what we've been running successfully for about a month now. I'd like to propose an alternative implementation that's a bit simpler which I parked in this draft pr #114
TBH, I consider this implementation simpler as the timer will get correctly reset in all scenarios (re-connects e.t.c.). The in-flight tracking PR makes sense but needs more work to make sure that the counter gets correctly reset.
In the meantime I will land this CL so it does not bitrot.
This PR implements a suggestion from https://github.com/achilleasa/dart_amqp/issues/106#issuecomment-1846280852.
The client-side heartbeat implementation is modified via the introduction of a new tuning parameter called
maxMissedHeartbeats
(default: 3).If heartbeats are enabled and the client sends
maxMissedHeartbeats
consecutive heartbeat messages at the interval negotiated with the broker without receiving any message (heartbeat or regular traffic) back, the client assumes that the server is not available and will raise a HeartbeatFailedException.Fixes #106