-
Notifications
You must be signed in to change notification settings - Fork 5
Processing a command
A command request is received by an event grid topic, with the parameters required to perform the command passed in the data parameter.
This triggers and azure function which, in turn, calls a Durable Function orchestrator. This orchestrator calls each step in the command handling process individually as Durable Function activities.
These individual steps write their progress to an event stream which underpins the command execution. This allows for post-hoc analysis of what the command handler did to perform that command.
With the exception of the "parameter validation" type of activity steps, the command handling activity functions would not return any value - instead they return a ActivityResponse that is used to log their operation.
` public class ActivityResponse {
/// <summary>
/// The name of the function that was called
/// </summary>
/// <remarks>
/// This is just for logging - it would not be advisable to use this for any
/// branch logic as it is up to the developer to set it correctly
/// </remarks>
public string FunctionName { get; set; }
/// <summary>
/// A message returned from the activity that can be logged
/// </summary>
public string Message { get; set; }
/// <summary>
/// The activity had a fatal error and the calling orchestrator should be terminated
/// </summary>
public bool FatalError { get; set; }
}`