Skip to content

Enforce classic queue type for non-durable and exclusive queues#70

Merged
nikosd23 merged 1 commit intomasterfrom
classic-queue-args
Jan 19, 2026
Merged

Enforce classic queue type for non-durable and exclusive queues#70
nikosd23 merged 1 commit intomasterfrom
classic-queue-args

Conversation

@nikossaravanos-workable
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enforces that non-durable, exclusive, or auto-delete queues always use the classic queue type, preventing incompatible configurations with quorum queues which must be durable and cannot be exclusive or auto-delete.

Changes:

  • Added logic to automatically set queue type to 'classic' for non-durable, exclusive, or auto-delete queues
  • Added comprehensive test coverage for the three enforcement scenarios (non-durable, exclusive, auto-delete)
  • Updated documentation explaining the queue type behavior and enforcement rules

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
ts/queue.ts Added conditional logic to enforce 'classic' queue type for non-durable, exclusive, or auto-delete queues
test/rabbit.test.ts Added three test cases verifying queue type enforcement for non-durable, exclusive, and auto-delete scenarios
test/queue.test.ts Updated existing test expectation to include the 'x-queue-type': 'classic' in arguments for exclusive queue
README.md Added "Queue Type Behavior" section documenting the enforcement rules and queue type immutability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ts/queue.ts
Comment thread ts/queue.ts
queueOptions.arguments = { ...queueOptions.arguments, 'x-max-priority': priority };
}
if (!durable || exclusive || autoDelete) {
queueOptions.arguments ??= {};
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nullish coalescing assignment operator at line 58 is redundant. At line 52, queueOptions.arguments is initialized with { ...this.options.arguments }, which will always result in an object (empty object if this.options.arguments is undefined). Therefore, queueOptions.arguments can never be null or undefined at line 58, making the ??= operator unnecessary. You can simply assign directly: queueOptions.arguments['x-queue-type'] = 'classic';

Suggested change
queueOptions.arguments ??= {};

Copilot uses AI. Check for mistakes.
@nikosd23 nikosd23 merged commit 23dc38e into master Jan 19, 2026
6 checks passed
@nikosd23 nikosd23 deleted the classic-queue-args branch January 19, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants