How to go back to a checkpoint with Azure EventHub

2019-08-16 03:59发布

I have an EventHub trigger implemented with Azure Functions App. My business logic implementation was wrong in that function and had to correct it. I have corrected my implementation on Functions App, how would I change the checkpoint to that Azure Function to go back 24 hours and make the stream data available to Functions App?

2条回答
戒情不戒烟
2楼-- · 2019-08-16 04:29

The problem remains that you likely don't know the sequence number used on each partition 24 hours ago, otherwise, Mikhail's suggestion may work with an modified step of going into each blob and editing the sequence number instead of deleting all blob entries.

You should probably just start from the beginning. Here are the steps:

  1. Go to the EventHub portal.
  2. Create a new consumer group, e.g. name it "GroupB"
  3. Edit your function.json and add the following entry to the trigger section,

"consumerGroup": "GroupB"

  1. Save your changes.

You should see that your Function will start processing events from the very beginning on the GroupB consumer group.

查看更多
Juvenile、少年°
3楼-- · 2019-08-16 04:35

When I needed to start processing of events in a Hub from scratch, I went to Blob Storage -> azure-webjobs-hosts container and deleted the blobs with names like yournamespace.servicebus.windows.net/yourhub/$Default/X. Those blobs store the current checkpoints, so if you restart the Function App, it will start processing from the first event.

I know it's hacky, but works for such basic scenario. Maybe somebody will suggest a better way.

查看更多
登录 后发表回答