-
Notifications
You must be signed in to change notification settings - Fork 142
Description
Describe the bug
When updaing the checkpoint store with an event from a given eventhub, the function UpdateCheckpoint() in class Azure::Messaging::EventHubs::ProcessorPartitionClient does not correctly extract the offset from this event, which leads to null offset in the checkpoint store as reported in this issue. Unfortunately this bug still exists in the main branch.
Current implementation in file: https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/eventhubs/azure-messaging-eventhubs/src/processor_partition_client.cpp (line 77-81):
std::string offset{};
if (!eventData->Offset.HasValue())
{
offset = eventData->Offset.Value();
}
Expected implementation:
std::string offset{};
if (eventData->Offset.HasValue())
{
offset = eventData->Offset.Value();
}
else {
throw std::runtime_error("Event does not have an offset.");
}