Skip to content

Add patch to stop publisher when RabbitMQ stops / closes connection

Mathias Védrines requested to merge 1-rabbitmq-stops into master

Previously, the pika async publisher code, when used "as is", handles reconnecting to RabbitMQ in some cases (channel closed or initial connection fail). But other unexpected conditions (connection closed, RabbitMQ service stopping or restarting) would lead to an irrecoverable state.

This change is an attempt at handling RabbitMQ stops/restarts and other unexpected disconnections in publisher, so that publisher stops without raising unmanaged exceptions.

The whole connector process stops and connector can be automatically restarted by systemd or a Docker orchestration tool.

Any experienced review about this change and the whole async programming with pika is welcome.

Closes #1 (closed)

Merge request reports