Skip to content

Commit

Permalink
Eventhub: Fix Partitioning (#1141)
Browse files Browse the repository at this point in the history
Eventhub's PartitionKey based routing for some reason was routing to
only the first and the last partitions.
So route to PartitionID instead.
  • Loading branch information
Amogh-Bharadwaj authored Jan 24, 2024
1 parent f92f4b3 commit 50fb5e5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flow/connectors/eventhub/hubmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 50fb5e5

Please sign in to comment.