Skip to content

Commit a6c3e59

Browse files
Respect SupportsOrdering property (#43531)
* Respect SupportsOrdering property * typo * Add test cases
1 parent 82cc7cf commit a6c3e59

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bugs Fixed
1010

11+
- Fixed issue where the `SupportOrdering` property was not being respected when set on `CreateTopicOptions`.
12+
1113
### Other Changes
1214

1315
## 7.17.5 (2024-04-09)

sdk/servicebus/Azure.Messaging.ServiceBus/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "net",
44
"TagPrefix": "net/servicebus/Azure.Messaging.ServiceBus",
5-
"Tag": "net/servicebus/Azure.Messaging.ServiceBus_36f6f28db7"
5+
"Tag": "net/servicebus/Azure.Messaging.ServiceBus_2c5f4fe7c3"
66
}

sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/CreateTopicOptions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public CreateTopicOptions(TopicProperties topic)
4545
Status = topic.Status;
4646
EnablePartitioning = topic.EnablePartitioning;
4747
MaxMessageSizeInKilobytes = topic.MaxMessageSizeInKilobytes;
48+
SupportOrdering = topic.SupportOrdering;
4849
if (topic.UserMetadata != null)
4950
{
5051
UserMetadata = topic.UserMetadata;
@@ -233,7 +234,8 @@ public bool Equals(CreateTopicOptions other)
233234
&& (AuthorizationRules != null && otherOptions.AuthorizationRules != null
234235
|| AuthorizationRules == null && otherOptions.AuthorizationRules == null)
235236
&& (AuthorizationRules == null || AuthorizationRules.Equals(otherOptions.AuthorizationRules))
236-
&& MaxMessageSizeInKilobytes.Equals(other.MaxMessageSizeInKilobytes))
237+
&& MaxMessageSizeInKilobytes.Equals(other.MaxMessageSizeInKilobytes)
238+
&& SupportOrdering == otherOptions.SupportOrdering)
237239
{
238240
return true;
239241
}

sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicProperties.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ internal TopicProperties(CreateTopicOptions options)
4545
Status = options.Status;
4646
EnableBatchedOperations = options.EnableBatchedOperations;
4747
EnablePartitioning = options.EnablePartitioning;
48+
SupportOrdering = options.SupportOrdering;
4849
if (options.UserMetadata != null)
4950
{
5051
UserMetadata = options.UserMetadata;

sdk/servicebus/Azure.Messaging.ServiceBus/tests/Administration/ServiceBusManagementClientLiveTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,11 @@ await client.GetQueueAsync(queueOptions.Name),
223223
}
224224

225225
[RecordedTest]
226-
[TestCase(false)]
227-
[TestCase(true)]
228-
public async Task BasicTopicCrudOperations(bool premium)
226+
[TestCase(false, false)]
227+
[TestCase(false, true)]
228+
[TestCase(true, false)]
229+
[TestCase(true, true)]
230+
public async Task BasicTopicCrudOperations(bool premium, bool supportOrdering)
229231
{
230232
var topicName = nameof(BasicTopicCrudOperations).ToLower() + Recording.Random.NewGuid().ToString("D").Substring(0, 8);
231233
var client = CreateClient(premium);
@@ -240,6 +242,7 @@ public async Task BasicTopicCrudOperations(bool premium)
240242
MaxSizeInMegabytes = 1024,
241243
RequiresDuplicateDetection = true,
242244
UserMetadata = nameof(BasicTopicCrudOperations),
245+
SupportOrdering = supportOrdering
243246
};
244247

245248
if (CanSetMaxMessageSize(premium))

0 commit comments

Comments
 (0)