Asynchronous execution of ApplicationListeners through annotation [SPR-3876] #8556
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Steven Devijver opened SPR-3876 and commented
Attached is a 3-class implementation that lets ApplicationListener implementations execute in an asynchronous fashion:
@Async
public class MyApplicationListener implements ApplicationListener {
public void onApplicationEvent(ApplicationEvent event) {
// do something
}
}
The implementation includes a BPP that detects
@Async
on ApplicationListeners and wraps them in a decorator with a TaskExecutor. On arrival of an event the onApplicationEvent() method is executed in a seperate thread.Attachments:
Issue Links:
2 votes, 3 watchers
The text was updated successfully, but these errors were encountered: