EventHandler retry

While I have configured command side to retry command with RetryScheduler I’m finding the way how to do similar with event side.
I see that RetryPolicy and ErrorHandler should help here but I don’t see the way how to propagate the number of “retryCount”. In RetryScheduler is list of Exceptions which indicates the number of retries. Currently events are rescheduled for execution in 2seconds and rescheduling never stops.

Here are my questions:

  1. How to implement “retryCount” on event side? Is it even ok to do this?
  2. What to do with event’s that cannot be processed? For example if I handle event in viewbuilder event listener, throw away this event and process next events my view will be in inconsistent state. (lets think about the situation that db was down for 5 seconds…)
  3. I’d like to let user know about something goes wrong. I’m thinking about implement websocket and send notification to user. Is this the right way or is there any simpler solution? Any examples?



Hi Lukas,

unfortunately, the API of the current ErrorHandler doesn’t provide any information about the number of retries. If you need to keep track of that, you could store it inside the ErrorHandler implementation itself. The combination of message and handler could form the key, and the list of error the value of a map. The challenge would be to remove the entries once the event has been correctly handled.