Closed marcinporebski closed 5 years ago
It is as per design. The documentation for sendBatch does mention that
Send a batch of EventData to the EventHub. The "message_annotations", "application_properties" and "properties" of the first message will be set as that of the envelope (batch message).
@sjkwak - Can you please comment on this?
Closing this issue as sendBatch can only support sending data to the same partition and this is by design.
Describe the bug When using batching mechanism along with partitionKey only first message's data is being taken into consideration. All messages from that batch goes to the same partition as the first one.
To Reproduce Send batch of messages with different partitionKey assigned. All messages will be broadcasted with parameters of the first one in batch.
Expected behavior I'd expect that partitionKey is being preserved and I can independently mark partition or partitionKey for each message.
Additional context Actual code that does the over-simplification is here: https://github.com/Azure/azure-event-hubs-node/blob/c677dba0a1da0cebbf996430e0f62a50b3e37595/client/lib/eventHubSender.ts#L302