Skip to content

Commit 55ea0d7

Browse files
authored
[Event Hubs] Fix enumerable send (#30370)
The focus of these changes is to fix a bug in the `SendAsync` overload that accepts and enumerable where the partition key is ignored.
1 parent a689dcc commit 55ea0d7

File tree

5 files changed

+216
-117
lines changed

5 files changed

+216
-117
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
## 5.8.0-beta.1 (Unreleased)
44

5-
### Features Added
5+
### Acknowledgments
66

7-
### Breaking Changes
7+
Thank you to our developer community members who helped to make the Event Hubs client libraries better with their contributions to this release:
88

9-
### Bugs Fixed
9+
- Daniel Marbach _([GitHub](https://github.com/danielmarbach))_
1010

1111
### Other Changes
1212

13+
- Miscellaneous performance improvements by reducing memory allocations. _(A community contribution, courtesy of [danielmarbach](https://github.com/danielmarbach))_
14+
1315
## 5.7.1 (2022-07-07)
1416

1517
### Acknowledgments

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ Thank you to our developer community members who helped to make the Event Hubs c
88

99
- Daniel Marbach _([GitHub](https://github.com/danielmarbach))_
1010

11-
### Features Added
12-
13-
### Breaking Changes
14-
1511
### Bugs Fixed
1612

13+
- Fixed a regression with the `EventHubProducerClient` overloads of `SendAsync` which accept an enumerable of events. When specifying a partition key, it was ignored when sending. As a result, the Event Hub applied round-robin partition assignment, spreading events across partitions rather than grouping them in a single partition.
14+
1715
### Other Changes
1816

1917
- Reduced memory allocations when converting messages into the underlying AMQP primitives. _(A community contribution, courtesy of [danielmarbach](https://github.com/danielmarbach))_

sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProducer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ protected virtual async Task SendAsync(IReadOnlyCollection<AmqpMessage> messages
479479

480480
try
481481
{
482-
using AmqpMessage batchMessage = MessageConverter.CreateBatchFromMessages(messages);
482+
using AmqpMessage batchMessage = MessageConverter.CreateBatchFromMessages(messages, partitionKey);
483483

484484
if (!SendLink.TryGetOpenedObject(out link))
485485
{

0 commit comments

Comments
 (0)