In our Project, we use two EventProcessorHost (different host name, same consumer group: hostA and hostB) to consume data from an EventHub, we send 100 messages(message 1 ~ message 100) to the hub, below is our processor code:
publicasyncTask ProcessEventsAsync(PartitionContext context, IEnumerable<EventData> events)
{
foreach (var eventData in events)
{
//handle the event data
}
await context.CheckpointAsync();
}
now we run two host to consume data, at first, only hostA can got data (message1, 2, 3, …),but when hostA got message50, then we got the
ReceiverDisconnectedException,then hostA cannot got data any more.
Then hostB start to consume data, but it not start with message50, it start with message40, it also can get message40-message50 which were got by hostA. We already call check point for each message when we got the message. If we close the HostB, the hostA also not got the message yet. If we run another host, host will got the data which was not consumed.
So how to make the HostB got data start with message50 when hostA got theReceiverDisconnectedException?