EventsSourcing-on-Azure-Functions icon indicating copy to clipboard operation
EventsSourcing-on-Azure-Functions copied to clipboard

Demo - ApplyAccruedInterestCommand - needs to be done using durable functions

Open MerrionComputing opened this issue 3 years ago • 3 comments

The "ApplyAccruedInterestCommand" function should fire off a durable functions orchestration (the same way that the AccrueInterest one does) so that the orchestration is all handled by that rather than event grid messages.

MerrionComputing avatar Mar 06 '22 14:03 MerrionComputing

This could be really difficult because of this:- https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-checkpointing-and-replay#orchestrator-code-constraints

MerrionComputing avatar Mar 06 '22 21:03 MerrionComputing

This means all asynch interaction with the Command event stream must be performed inside of an Activity type of function

MerrionComputing avatar Mar 07 '22 11:03 MerrionComputing

In fact there needs to be some more work as when the durable function orchestration is called again (as it is for the orchestration function to work) then a new unique identifier is assigned for the Command even though it is the same orchestration...

There needs to be a way to pick up the orchestration identifier and use that instead of the new guid when the command is instantiated...or a constructor for the Command that takes the parameter of IDurableOrchestrationContext

MerrionComputing avatar Mar 13 '22 17:03 MerrionComputing