user1099593
user1099593

Reputation: 21

Azure Event Hub Offset

I have implemented the code from the below link for receiving events from the event hub. But say there are 10 events and checkpoint is done for every 5 events. Now the program exits abnormally when reading the 7th event and if i restart the event processor host again then events (1,2,3,4,6) are re-read. Please suggest how will I again avoid re-read and read from the 7th event? Any example would be appreciated. Thanks.

https://github.com/Azure/azure-event-hubs/blob/master/samples/Java/src/main/java/com/microsoft/azure/eventhubs/samples/Basic/EventProcessorSample.java

Upvotes: 1

Views: 2367

Answers (1)

Peter Bons
Peter Bons

Reputation: 29780

Well, in the context of the event hub it is your job to handle possible message duplication as the event hub guarantees at least once delivery, see

Does Azure Event Hub guarantees at least once delivery?

We do not know your scenario so we cannot suggest something other than for you to build a duplicate message detection mechanism. For example, adding a unique id to the data prior to sending it to the event hub and have the processor check that against a list of processed messages.

Upvotes: 3

Related Questions