On listening from Azure Event Hub I am getting error
The supplied offset XXXXX is invalid. The last offset in the system is XXXXX
Error on Partition 1: The AMQP Object session is aborted. Error on Partition 0: The supplied offset is invalid.
On listening from Azure Event Hub I am getting error
The supplied offset XXXXX is invalid. The last offset in the system is XXXXX
Error on Partition 1: The AMQP Object session is aborted. Error on Partition 0: The supplied offset is invalid.
I had the same issue. It was because of sharing an instance of EventPosition class.
var position = EventPosition.FromStart();
var eventProcessorHost = new EventProcessorHost(
eventHubName,
consumerGroupName,
eventHubConnectionString,
storageConnectionString,
LeaseContainerName);
host.RegisterEventProcessorFactoryAsync(
processorFactory,
new EventProcessorOptions
{
// Problem is the following line.
// In order to fix it replace 'position' with 'EventPosition.FromStart()'
InitialOffsetProvider = partitionId => position
}).Wait();
Apparently, if you share an instance of position class, then ProcessorHost uses the same object for different IEventProcessor(s). As this object contains offset value it leads to passing the same offset to different partitions - obviously, it leads to the problem if an offset is different among partitions.