How to replay the messages in azure eventhub

132 Views Asked by At

I have a azure eventhub and has multiple consumers for the eventhub. Checkpoint are available for these consumers. I would like to replay the messages for a specific consumer. How can I achieve this? and if it is by changing the sequence number/offset value then what number should I use in the sequence number or offset value to replay messages and where should I get those values?

1

There are 1 best solutions below

0
On

To reset processing and restart from the beginning of each partition, you'll first want to stop your Function application. Attempting to manipulate or remove data while its running is not a good idea and may manifest in unexpected ways.

Next, you'll want to verify that your host.json configuration either does not specify the initialOffsetOptions or sets the type as "fromStart". For example:

{
    "version": "2.0",
    "extensions": {
        "eventHubs": {
            "initialOffsetOptions" : {
                "type" : "fromStart",
                "enqueuedTimeUtc" : ""
            }
        }
    }
}  

Next, you'll need to remove the checkpoint data. Your best option would be to delete the checkpoint and ownership blobs that the trigger writes.

When you start the Function app running again, it won't find checkpoints and will use the "initialOffsetOptions" as a default starting position, reading from the beginning of each partition.