feat(rabbitmq): configurable error/audit queue arguments#21
Merged
Conversation
Add consumer.errorQueueArguments and consumer.auditQueueArguments,
mirroring the existing queueArguments/retryQueueArguments hooks, so the
error and audit queues can be declared with RabbitMQ arguments (e.g.
{ 'x-queue-type': 'quorum' }). Previously both were hardcoded as
{ queue, durable: true } with no arguments hook, forcing them to stay
classic queues.
The consumer already forwards QueueSpec.arguments to queueDeclare, so
only options resolution and topology construction change. Empty args
resolve to arguments: {}, which queueDeclare treats identically to no
arguments, keeping the change backward-compatible.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds two new consumer options to
@serviceconnect/rabbitmq, mirroring the existingqueueArguments/retryQueueArgumentshooks:consumer.errorQueueArguments?: Record<string, unknown>consumer.auditQueueArguments?: Record<string, unknown>These flow into the error and audit queue declarations, so they can be declared with RabbitMQ arguments — e.g. as quorum queues:
Why
The main and retry queues already accept arguments, but the error and audit queues were hardcoded as
{ queue, durable: true }with no arguments hook, forcing them to stay classic queues. This closes that gap so all four declared queues expose the same configuration surface.Changes
packages/rabbitmq/src/options.ts— new fields on theconsumerinterface andResolvedConsumerOptions; default to{}inresolveConsumerOptions.packages/rabbitmq/src/topology.ts— spread the resolved arguments into the error and auditQueueSpecs.The consumer already forwards
QueueSpec.argumentstoqueueDeclare, so no consumer change was needed.Compatibility
Backward-compatible: empty args resolve to
arguments: {}, whichqueueDeclaretreats identically to no arguments. No wire-format or C# master-parity impact (queue arguments are a broker concern, not part of the message contract).Operational note:
x-queue-typeis fixed at declare time — an existing classic error/audit queue must be deleted before it can be redeclared as quorum.Testing
topology.test.tsand pass-through/default tests inoptions.test.ts.tsc --noEmitandbiome checkclean.🤖 Generated with Claude Code