From 50fb5e5fb478439bcc09e35d395c83c4dc78ad98 Mon Sep 17 00:00:00 2001 From: Amogh Bharadwaj Date: Wed, 24 Jan 2024 19:53:44 +0530 Subject: [PATCH] Eventhub: Fix Partitioning (#1141) Eventhub's PartitionKey based routing for some reason was routing to only the first and the last partitions. So route to PartitionID instead. --- flow/connectors/eventhub/hubmanager.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flow/connectors/eventhub/hubmanager.go b/flow/connectors/eventhub/hubmanager.go index 3635544d3c..19f608c4bf 100644 --- a/flow/connectors/eventhub/hubmanager.go +++ b/flow/connectors/eventhub/hubmanager.go @@ -127,10 +127,9 @@ func (m *EventHubManager) CreateEventDataBatch(ctx context.Context, destination } opts := &azeventhubs.EventDataBatchOptions{ - // Eventhubs internally does the routing - // to partition based on hash of the partition key. - // Same partition key is guaranteed to map to same partition. - PartitionKey: &destination.PartitionKeyValue, + // We want to route same hashed partition value + // to same partition. + PartitionID: &destination.PartitionKeyValue, } batch, err := hub.NewEventDataBatch(ctx, opts) if err != nil {