Reprocessing¶
Certain durable use cases are designed to allow reprocessing when operational errors are encountered.
Terms¶
Operational error
-
An error not related to business logic. Includes:
- Timeouts
- Network errors
- Server errors
Durable use case
-
Use cases that may trigger a retry upon failure. Typically a special sequence UC 74 is called to push the message into the retry queue.
Primarily not intended for use cases that require an immediate response, however durable use cases may be dispatched during the flow for durability.
Dispatch
-
When a use case (sequence) calls another durable use case, the sub-process is considered "fire and forget".
- The calling UC requires no response from the dispatched UC
- A failure in the dispatched UC is isolated and would only trigger a retry in the scope of the called UC.
Sequence design considerations¶
When a message is retried, the entire sequence is rerun. For this reason, use cases with retry in mind follow these patterns:
- Lookups an idempotent operations are called early in the flow.
- Non idempotent operations either:
- have a guard check to avoid a dupe...
- or happen as the final durable step
-
Dispatched calls of use cases are at the end of the flow as to avoid duplicate calls upon retry. In other words, a sequence like the following would never cause a dupe event or alert because the endpoint call is the last node that could trigger a retry:
- Start UC
- Call EWS endpoint
- Call PCS endpoint
- Dispatch UC 70 - "fire and forget"
- Dispatch UC 67 - "fire and forget"
- End UC