zoukankan      html  css  js  c++  java
  • axon controller 不能获取 event里面自定义 exception 的解决方式

    配置:

    @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;
    }
    }
  • 相关阅读:
    OS-lab4
    OS-lab3
    OS-lab2
    OS-lab1
    OO第四单元总结
    OO第三单元总结
    OO第二单元总结
    HTTP_POST
    实习日志1(2020.7.27-2020.9.31)
    Web app ------ 从Servlet读取Json数据并显示,生成历史数据曲线图
  • 原文地址:https://www.cnblogs.com/lshan/p/11313183.html
Copyright © 2011-2022 走看看