配置:
@Configuration public class MyAxonConfiguration extends EventHandlingConfiguration{ @Bean public EventHandlingConfiguration eventHandlingConfiguration(EventHandlingConfiguration config) { config.configureListenerInvocationErrorHandler(c -> c.getComponent(ListenerInvocationErrorHandler.class, MyErrorHandlerImpl::new)); return config; } }@Component public class MyErrorHandlerImpl implements ListenerInvocationErrorHandler{ private static final Logger LOGGER = getLogger(MyErrorHandlerImpl.class); @Override public void onError(Exception exception, EventMessage<?> event, EventListener eventListener) throws Exception { LOGGER.info("☋☋☋☋☋☋☋☋☋☋☋☋ Start MyErrorHandlerImpl ☋☋☋☋☋☋☋☋☋☋☋☋"); throw exception; } }