Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Implemented
-
None
-
None
Description
Goal
The goal of this ticket is to implement a system-wide (API and external events) idempotency solution for Fineract.
Background
Fineract is deployed in many organizations where high-availability and fault-tolerance is essential. One of the solutions to APIs suddenly crashing is to retry the requests to those APIs.
In these situations it can occur that an operation is retried even though a former execution has already completed resulting in 2 executions of the same operations.
The system needs to be able to detect these scenarios and prevent executing the same request multiple times.
Also, the emitted external events Fineract is sending should provide a similar behavior to the above to detect events which are for the same operation.
Idempotency imply changes in the following
- API contract: Idempotency-Key header
- External event framework contract. Use of idempotencyKey attribute
- Command execution recap
- Storing the idempotency information; m_portfolio_command_source table
- Introducing proper statuses to commands; UNDER_PROCESSING and ERROR status.
- Command execution changes
- Purging commands