Repository navigation
Improve AMQP Producer: robust reconnection, topology setup retries and channel readiness gate
✨ Release Notes
🔧 AMQP Producer Improvements
This release introduces major changes to how the AMQP Producer handles connection loss and reconnection. The code was restructured to eliminate race conditions and intermittent failures that previously caused errors such as:
- connection/channel is not open;
- Error setting up topology after reconnection (504).
With this release, the Producer now has a robust and predictable reconnection flow.
🚀 Key Changes
Implemented a readiness gate (readyCh) that blocks drainInternalQueue until the topology is fully configured.
Added a reconfiguration mutex (reconfMu) to guarantee atomic swaps of channel, notifyConfirm, and notifyClose.
handleReestablishedConnnection now includes retry with backoff until the topology is successfully rebuilt, and only resumes publishing when everything is stable.
drainInternalQueue now retries publishing on errors or timeouts without terminating its goroutine.
The "Connection reestablished" log was moved to occur after topology configuration, ensuring the log reflects the actual state of the Producer.
🛡 Expected Impact
Greater resilience in RabbitMQ connection drop scenarios.
No more false positives where logs claimed “reestablished” while the channel was still unavailable.
Stable publishing flow, reducing risks of message loss or producer deadlock.
👉 This release is recommended for all environments using the AMQP Producer, especially under high-load or network instability conditions.