Seeking advice on handling Projection EventHandler failures

On the Projection side, if logic in an EventHandler fails (maybe the network request to ElasticSearch or an Azure database is down), how is this typically handled?

Out of the box, it seems like if an exception is thrown, it’s logged and the system moves on to the next event. I believe I can’t dismiss this event or the read-model will clearly get out of sync with the write-model. I don’t think I want to process the next event if I know I can’t persist it anyhow.

I have to think this is a basic concern that Axon already solves, I’m just not familiar with the solution yet.

The documentation around event-handlers is pretty good, but I’m getting a little lost.

Any help or ideas would be greatly appreciated.

It appears I’ve established the ‘retry’ outcome for the project @EventHandler (as discussed here) I desired by implementing the below configuration. I now see the 1, 2, 4, 8 second retries I was hoping for. Once I got it working, the documentation became a little more clear.


import org.axonframework.eventhandling.ListenerInvocationErrorHandler;

import org.axonframework.eventhandling.PropagatingErrorHandler;

import org.springframework.context.annotation.Bean;

import org.springframework.context.annotation.Configuration;


public class ErrorHandlerConfiguration {


public void configurationEventHandling(EventProcessingConfigurer config) {

config.registerDefaultListenerInvocationErrorHandler(configuration -> PropagatingErrorHandler.instance());