Re-lease delayed messages before RabbitMQ's consumer_timeout - #877
Open
davidt99 wants to merge 1 commit into
Open
Re-lease delayed messages before RabbitMQ's consumer_timeout#877davidt99 wants to merge 1 commit into
davidt99 wants to merge 1 commit into
Conversation
Contributor
Author
|
@LincolnPuzey as agreed, I'm only handling the consumer timeout. Although the behavior is relevant for rabbitmq, it exists on other potential brokers. |
davidt99
force-pushed
the
rabbitmq-consumer-timeout
branch
from
July 15, 2026 11:04
bb1d947 to
f56bf98
Compare
RabbitMQ requeues any delivery left unacked past its consumer_timeout (default 30 min, enforced since 3.8.15 on any queue type). Dramatiq holds delayed/retried messages unacked in memory until their eta, so a delay longer than the timeout is requeued by the server before it runs, churning the delay queue (Bogdanp#827). Add an optional consumer_timeout to RabbitmqBroker. When set, it is sent as an x-consumer-timeout consumer argument on the delay-queue consumer only (honoured by RabbitMQ 3.12+), and the worker re-leases a held delayed message at 0.75x that value -- re-enqueuing it with its remaining delay so the eta is preserved and it still fires exactly once. Worker-side and queue-type agnostic; defaults to None (unchanged), minimum 15 minutes. Addresses Bogdanp#827. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
davidt99
force-pushed
the
rabbitmq-consumer-timeout
branch
from
July 23, 2026 11:19
f56bf98 to
05a8f18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RabbitMQ requeues any delivery left unacked past its consumer_timeout (default 30 min, enforced since 3.8.15 on any queue type). Dramatiq holds delayed/retried messages unacked in memory until their eta, so a delay longer than the timeout is requeued by the server before it runs, churning the delay queue (#827).
Add an optional consumer_timeout to RabbitmqBroker. When set, it is sent as an x-consumer-timeout consumer argument on the delay-queue consumer only (honoured by RabbitMQ 3.12+), and the worker re-leases a held delayed message at 0.75x that value -- re-enqueuing it with its remaining delay so the eta is preserved and it still fires exactly once. Worker-side and queue-type agnostic; defaults to None (unchanged), minimum 15 minutes.
Addresses #827.