Skip to content

Commit

Permalink
Respect SupportsOrdering property (#43531)
Browse files Browse the repository at this point in the history
* Respect SupportsOrdering property

* typo

* Add test cases
  • Loading branch information
JoshLove-msft authored Apr 19, 2024
1 parent 82cc7cf commit a6c3e59
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
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

0 comments on commit a6c3e59

Please sign in to comment.