Senior
Does the order of message processing affect the result? For example, if the crediting failed in DLT, can it be rolled back?
sobes.tech AI
Answer from AI
The order of message processing is critically important, especially in financial operations. If a credit operation ends up in the Dead Letter Topic (DLT), it means it was not successfully processed and requires manual or automatic intervention.
In such cases, funds cannot be debited because the credit has not been confirmed. Violating the order can lead to balance desynchronization and accounting errors.
The correct approach:
- Process and correct messages in the DLT.
- Ensure that the credit was successful.
- Only after that, perform the debit.
This guarantees data consistency and correctness of business logic.