Conversation
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>
Contributor
There was a problem hiding this comment.
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
QueueTypegetter fromIQueueSpecificationandAmqpQueueSpecification(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 againstQueueTypeenum values, butType(...)stores a string (e.g. "quorum"), and when the user does not callType(...)the key won't exist. This will either throwKeyNotFoundExceptionfor the default case, or never match for quorum/stream (so the mandatoryExclusive(false).AutoDelete(false)override won't run). UseTryGetValueand 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>
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.
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:
Fixes: #146