Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect SupportsOrdering property #43531

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Bugs Fixed

- Fixed issue where the `SupportOrdering` property was not being respected when set on `CreateTopicOptions`.

### Other Changes

## 7.17.5 (2024-04-09)
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/Azure.Messaging.ServiceBus/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/servicebus/Azure.Messaging.ServiceBus",
"Tag": "net/servicebus/Azure.Messaging.ServiceBus_36f6f28db7"
"Tag": "net/servicebus/Azure.Messaging.ServiceBus_2c5f4fe7c3"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public CreateTopicOptions(TopicProperties topic)
Status = topic.Status;
EnablePartitioning = topic.EnablePartitioning;
MaxMessageSizeInKilobytes = topic.MaxMessageSizeInKilobytes;
SupportOrdering = topic.SupportOrdering;
if (topic.UserMetadata != null)
{
UserMetadata = topic.UserMetadata;
Expand Down Expand Up @@ -233,7 +234,8 @@ public bool Equals(CreateTopicOptions other)
&& (AuthorizationRules != null && otherOptions.AuthorizationRules != null
|| AuthorizationRules == null && otherOptions.AuthorizationRules == null)
&& (AuthorizationRules == null || AuthorizationRules.Equals(otherOptions.AuthorizationRules))
&& MaxMessageSizeInKilobytes.Equals(other.MaxMessageSizeInKilobytes))
&& MaxMessageSizeInKilobytes.Equals(other.MaxMessageSizeInKilobytes)
&& SupportOrdering == otherOptions.SupportOrdering)
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ internal TopicProperties(CreateTopicOptions options)
Status = options.Status;
EnableBatchedOperations = options.EnableBatchedOperations;
EnablePartitioning = options.EnablePartitioning;
SupportOrdering = options.SupportOrdering;
if (options.UserMetadata != null)
{
UserMetadata = options.UserMetadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ await client.GetQueueAsync(queueOptions.Name),
}

[RecordedTest]
[TestCase(false)]
[TestCase(true)]
public async Task BasicTopicCrudOperations(bool premium)
[TestCase(false, false)]
[TestCase(false, true)]
[TestCase(true, false)]
[TestCase(true, true)]
public async Task BasicTopicCrudOperations(bool premium, bool supportOrdering)
{
var topicName = nameof(BasicTopicCrudOperations).ToLower() + Recording.Random.NewGuid().ToString("D").Substring(0, 8);
var client = CreateClient(premium);
Expand All @@ -240,6 +242,7 @@ public async Task BasicTopicCrudOperations(bool premium)
MaxSizeInMegabytes = 1024,
RequiresDuplicateDetection = true,
UserMetadata = nameof(BasicTopicCrudOperations),
SupportOrdering = supportOrdering
};

if (CanSetMaxMessageSize(premium))
Expand Down