azureazure-eventhub

Azure Eventhub Sequence Number sequencing


I know the below is true for sequence number within a partition :-

Sequence Number follows a predictable pattern where numbering is contiguous and unique within the scope of a partition. So if message x has sequence number 500 , message y will have sequence number 501.

Say last sequence number when message was received was 5000, and then no more messages were received and after 7 days retention policy , on 10th day we receive a message on the partition , will the sequence number start from 5001 or will it be different this time?

The reason i am asking because I am seeing: "The expected sequence number xxx is less than the received sequence number yyy."?

For example:- The supplied sequence number '33508' is invalid. The last sequence number in the system is '583'


Solution

  • Just to update this post with answer, we found the concerned EventHubs are indeed recreated, but checkpoint store was not reset. Thus, SequenceNumber presented by client (read from checkpoint store) was greater than latest sequence number at service.

    As Serkant confirmed above, Sequence number is always contiguous. It can only be interrupted by recreating the eventhub. Typically, you shouldn’t have a need to delete and recreate EventHub in production. But in case you run into the situation, you should also reset checkpoint store.