Implement outbox for ongoing contribution for item events.
Description
Environment
None
Potential Workaround
None
is defined by
Checklist
hideActivity
Show:
Done
Created May 24, 2024 at 11:01 AM
Updated October 30, 2024 at 9:05 PM
Resolved June 10, 2024 at 11:59 AM
TestRail: Cases
TestRail: Runs
For persisting records into outbox table:
Create a new table ongoing_contribution_status for storing kafka events. Once the List<DomainEvent<Item>> from kafka is received , group the events by tenant and iterate every tenant and persist the domain events (both old and new) against every centralServerId with READY status. In addition to events, we need to maintain metadata, actionType and domainEventType so that it will be used to determine the kind of business logic that we need to use at the time of processing.
For processing the record:
Introduce a new scheduler, fetch the list of records which are in READY or in RETRY status and change the status to inprogress. we will execute the business logic which will be as same as the current code. Once the process is completed , we will change the status of the record to PROCESSED. If any error encounters, change the status to FAILED and exception will be updated in error_message column. If we encounter of the retry exception, then we need to update the status to RETRY and increment the retry count. If the retry is exhausted, then it will result in the error.
Interested parties :
As part of this ticket, everything mentioned in the ticket should gets implemented and PR will have to be created. PR review should be taken care in separate ticket