We have the following setup:
Event Hub —-> Azure Function —> API.
We are trying to come up with a solution for Dead lettering with Event Hub. Event hub doesn’t come with Dead Lettering, hence we need to build our own solution.
We came up with 2 options :
An Azure Function with Event Hub trigger, will have try catch block, it does have a retry policy to call the Api, if the call fails after all the attempts , we will store the event, metadata( offset of the event) in azure table storage so that we can reprocess this event from table storage using DLQ re-processor.
A Durable Function with Event Hub trigger. Will have an orchestrator and activity functions. If the processing an event fails with an error, we can retry the activity functions since it’s persisted.
I would like to know which option is a better choice here. I am not able to understand how the Deterministic policy of Durable Functions come in to play here.
We tried option 1 and have a feeling that we are building a state machine in azure storage. We are expecting if azure durable functions built in features will help us in handling dead lettering and resiliency.