配置:

@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;
}
}

 

posted on 2019-08-07 09:27  lshan  阅读(204)  评论(0编辑  收藏  举报