Skip to content

Remove default value#145

Merged
Gsantomaggio merged 2 commits intomainfrom
fix/remove_default_queue_value
Feb 12, 2026
Merged

Remove default value#145
Gsantomaggio merged 2 commits intomainfrom
fix/remove_default_queue_value

Conversation

@Gsantomaggio
Copy link
Member

@Gsantomaggio Gsantomaggio commented Feb 12, 2026

while creating a queue. If not set the server has to use the default queue type for vhost

This PR aims to stop implicitly defaulting queue type to classic when creating/declaring a queue, allowing the broker to apply the vhost’s default queue type when the client does not explicitly set one.

Changes:

  • Removed QueueType getter from IQueueSpecification and AmqpQueueSpecification (and corresponding API tracking entries).
  • Updated DeclareAsync() logic intended to apply mandatory settings for quorum/stream queues.

Fixes: #146

while creating a queue. If not set the server has to use the default queue type for vhost

Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
@Gsantomaggio Gsantomaggio added this to the 0.51.0 milestone Feb 12, 2026
@Gsantomaggio Gsantomaggio self-assigned this Feb 12, 2026
@Gsantomaggio Gsantomaggio requested a review from Copilot February 12, 2026 12:23
@Gsantomaggio Gsantomaggio marked this pull request as ready for review February 12, 2026 12:24
Copy link
Contributor

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 aims to stop implicitly defaulting queue type to classic when creating/declaring a queue, allowing the broker to apply the vhost’s default queue type when the client does not explicitly set one.

Changes:

  • Removed QueueType getter from IQueueSpecification and AmqpQueueSpecification (and corresponding API tracking entries).
  • Updated DeclareAsync() logic intended to apply mandatory settings for quorum/stream queues.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
RabbitMQ.AMQP.Client/PublicAPI.Unshipped.txt Removes unshipped API entries for QueueType getter to match the new surface area.
RabbitMQ.AMQP.Client/Impl/AmqpQueueSpecification.cs Removes the QueueType property and changes quorum/stream detection in DeclareAsync().
RabbitMQ.AMQP.Client/IEntities.cs Removes QueueType getter from IQueueSpecification.
Comments suppressed due to low confidence (1)

RabbitMQ.AMQP.Client/Impl/AmqpQueueSpecification.cs:300

  • In DeclareAsync this indexes _queueArguments["x-queue-type"] unconditionally and pattern-matches it against QueueType enum values, but Type(...) stores a string (e.g. "quorum"), and when the user does not call Type(...) the key won't exist. This will either throw KeyNotFoundException for the default case, or never match for quorum/stream (so the mandatory Exclusive(false).AutoDelete(false) override won't run). Use TryGetValue and compare against the stored string values ("quorum"/"stream"), or track the queue type in a separate nullable field and use that for the check while still sending the string argument to the server.
        public async Task<IQueueInfo> DeclareAsync()
        {
            if (_queueArguments["x-queue-type"] is QueueType.QUORUM or QueueType.STREAM)
            {
                // mandatory arguments for quorum queues and streams
                Exclusive(false).AutoDelete(false);
            }

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

while creating a queue. If not set the server has to use the default queue type for vhost

Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
@Gsantomaggio Gsantomaggio merged commit af6ab1d into main Feb 12, 2026
2 checks passed
@Gsantomaggio Gsantomaggio deleted the fix/remove_default_queue_value branch February 12, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't declare queue without type

1 participant

Comments