I'm consuming EventData
events from an Azure Event Hub using Azure Functions 1.x. However, I noticed that the PartitionKey
is always null. Yet, Offset
and SequenceNumber
are both populated.
I know it's optional for the sender to set the PartitionKey
. In fact, it's recommended not to set it for performance reasons. However, I assumed that somewhere along the way to the consumer, the PartitionKey
would be set with the partition that processed the EventData
.
If that's not the case, what's the point of sending the Offset
and SequenceNumber
? Each partition maintains its own Offset
and SequenceNumber
. If I wanted to replay an event, how would I do so without knowing the PartitionKey
?
Edit:
I just found out that if I bind to the PartitionContext
, I can view the PartitionId
that the EventData
came from. Why isn't this used to populate the PartitionKey
on the EventData
? Is this a bug with Azure Functions?