60s heartbeat timeouts on RabbitMQ

This commit is contained in:
Cyber MacGeddon 2026-04-21 21:22:41 +01:00
parent c590e9b52a
commit 4d57747a9a

View file

@ -326,7 +326,15 @@ class RabbitMQBackend:
port=port,
virtual_host=vhost,
credentials=pika.PlainCredentials(username, password),
heartbeat=0,
# Heartbeats let us detect silently-dead connections
# (broker restarts, network partitions, orphaned channels)
# within ~2×interval. Consumer threads drive pika's I/O
# loop every 100ms via process_data_events() in receive(),
# so heartbeat frames get pumped automatically. Producers
# reconnect lazily on the next publish if their connection
# has been aged out by the broker.
heartbeat=60,
blocked_connection_timeout=300,
)
logger.info(f"RabbitMQ backend: {host}:{port} vhost={vhost}")