Reputation: 437
I was just wondering what are the standard approaches for recovering,replaying messages in message driven architecture.
Take for instance
A consumer unexpectedly dies before completing the event and updating the status to complete or what if the event is taking longer than usual to complete.
Each event will have a row on a table so that we can track the event. Lets say the replay is triggered when an event row has not been updated for some period of time say 15 minutes and the status is not complete.
In either case where a consumer dies unexpectedly or an event is taking more than 15 minutes. A replay would be triggered. This will result in duplicate events for the same message.
One approach to solve the hung process is to have a timeout and kill the process after that. Is there other ways?
Upvotes: 0
Views: 182
Reputation: 6880
It is expected that on failure the event will be redelivered. So the event processing must be idempotent.
How exactly the idempotency is achieved depends on a specific use case.
Upvotes: 2