Spring publishEvent 异步执行

8月 28, 2022 |

方法1使用@Async注解

使用spring applicationContext 发布事件

@EventListener和@Async注解

SpringApplication添加@EnableAsync注解

@Configuration注册一个TaskExecutor Bean

方法2 自定义SimpleApplicationEventMulticaster

Posted in: spring practise

Comments are closed.