How to go back to a checkpoint with Azure EventHub Trigger to Functions?

萝らか妹 提交于 2019-12-08 06:19:06

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/46199269/how-to-go-back-to-a-checkpoint-with-azure-eventhub-trigger-to-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!