Skip to content

Commit 48c0f9c

Browse files
authored
[Event Hubs] Release Prep + Partition Key Tests (#30391)
* [Event Hubs] Release Prep + Partition Key The focus of these changes is to ensure that the partition key is correctly considered for all publishing scenarios; some overloads were not setting the key during message conversion, causing round-robin routing to be applied.
1 parent 5ec3a56 commit 48c0f9c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 5.8.0-beta.1 (Unreleased)
3+
## 5.7.2 (2022-08-09)
44

55
### Acknowledgments
66

sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Description>Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This client library allows for both publishing and consuming events using Azure Event Hubs. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/</Description>
4-
<Version>5.8.0-beta.1</Version>
4+
<Version>5.7.2</Version>
55
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
66
<ApiCompatVersion>5.7.1</ApiCompatVersion>
77
<PackageTags>Azure;Event Hubs;EventHubs;.NET;AMQP;IoT;$(PackageCommonTags)</PackageTags>

sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpProducerTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ public async Task SendEnumerableUsesThePartitionKey()
11801180
[TestCase(null)]
11811181
[TestCase("")]
11821182
[TestCase("someKey")]
1183-
public async Task SendEnumerableCreatesTheAmqpMessageFromTheEnumerable(string partitonKey)
1183+
public async Task SendEnumerableCreatesTheAmqpMessageFromTheEnumerable(string partitionKey)
11841184
{
11851185
var amqpMessages = default(IReadOnlyCollection<AmqpMessage>);
11861186
var events = new List<EventData> { new EventData(new byte[] { 0x15 }) };
@@ -1200,13 +1200,13 @@ public async Task SendEnumerableCreatesTheAmqpMessageFromTheEnumerable(string pa
12001200
.Callback<IReadOnlyCollection<AmqpMessage>, string, CancellationToken>((messages, key, token) => amqpMessages = messages)
12011201
.Returns(Task.CompletedTask);
12021202

1203-
await producer.Object.SendAsync(events, new SendEventOptions { PartitionKey = partitonKey }, CancellationToken.None);
1203+
await producer.Object.SendAsync(events, new SendEventOptions { PartitionKey = partitionKey }, CancellationToken.None);
12041204

12051205
Assert.That(amqpMessages, Is.Not.Null, "The AMQP messages should have been set.");
12061206
Assert.That(amqpMessages.Count, Is.EqualTo(events.Count), "An AMQP message should exist for each source event.");
12071207

1208-
using var batchMessage = converter.CreateBatchFromEvents(events, partitonKey);
1209-
using var amqpSourceMessage = converter.CreateBatchFromMessages(amqpMessages);
1208+
using var batchMessage = converter.CreateBatchFromEvents(events, partitionKey);
1209+
using var amqpSourceMessage = converter.CreateBatchFromMessages(amqpMessages, partitionKey);
12101210

12111211
Assert.That(amqpSourceMessage.SerializedMessageSize, Is.EqualTo(batchMessage.SerializedMessageSize), "The serialized size of the messages should match.");
12121212
}
@@ -1556,11 +1556,11 @@ public async Task SendBatchUsesThePartitionKey()
15561556
[TestCase(null)]
15571557
[TestCase("")]
15581558
[TestCase("someKey")]
1559-
public async Task SendBatchCreatesTheAmqpMessageFromTheBatch(string partitonKey)
1559+
public async Task SendBatchCreatesTheAmqpMessageFromTheBatch(string partitionKey)
15601560
{
15611561
var amqpMessages = default(IReadOnlyCollection<AmqpMessage>);
15621562
var expectedMaximumSize = 512;
1563-
var options = new CreateBatchOptions { PartitionKey = partitonKey };
1563+
var options = new CreateBatchOptions { PartitionKey = partitionKey };
15641564
var retryPolicy = new BasicRetryPolicy(new EventHubsRetryOptions { TryTimeout = TimeSpan.FromSeconds(17) });
15651565
var converter = new AmqpMessageConverter();
15661566

@@ -1600,8 +1600,8 @@ public async Task SendBatchCreatesTheAmqpMessageFromTheBatch(string partitonKey)
16001600
Assert.That(amqpMessages, Is.Not.Null, "The AMQP messages should have been set.");
16011601
Assert.That(amqpMessages.Count, Is.EqualTo(messages.Count), "An AMQP message should exist for each source event.");
16021602

1603-
using var batchMessage = converter.CreateBatchFromMessages(messages, partitonKey);
1604-
using var amqpSourceMessage = converter.CreateBatchFromMessages(amqpMessages);
1603+
using var batchMessage = converter.CreateBatchFromMessages(messages, partitionKey);
1604+
using var amqpSourceMessage = converter.CreateBatchFromMessages(amqpMessages, partitionKey);
16051605

16061606
Assert.That(amqpSourceMessage.SerializedMessageSize, Is.EqualTo(batchMessage.SerializedMessageSize), "The serialized size of the messages should match.");
16071607
}

0 commit comments

Comments
 (0)