ApplicationEventPublisher

ApplicationEventPublisher 事件发布者

ApplicationEvent 事件

ApplicationListener 事件监听器

ApplicationEvent默认并不是异步的,如果需要异步需要我们在方法上加上@Async注解,并在启动类添加@EnableAsync开启异步

@TransactionalEventListener 可以在事务提交后执行
@EventLister 可以代替ApplicationListener接口

@Async
@EnableAsync

 

 

https://blog.csdn.net/qq330983778/article/details/99762511

posted @ 2022-10-26 14:04  ENU  阅读(113)  评论(0编辑  收藏  举报