Interface TransactionalApplicationListener<E extends ApplicationEvent>

Type Parameters:
E - the specific ApplicationEvent subclass to listen to
All Superinterfaces:
ApplicationListener<E>, EventListener, Ordered
All Known Implementing Classes:
TransactionalApplicationListenerAdapter, TransactionalApplicationListenerMethodAdapter

public interface TransactionalApplicationListener<E extends ApplicationEvent> extends ApplicationListener<E>, Ordered
An ApplicationListener that is invoked according to a TransactionPhase. This is a programmatic equivalent of the TransactionalEventListener annotation.

Adding Ordered to your listener implementation allows you to prioritize that listener amongst other listeners running before or after transaction completion.

NOTE: Transactional event listeners only work with thread-bound transactions managed by a PlatformTransactionManager. A reactive transaction managed by a ReactiveTransactionManager uses the Reactor context instead of thread-local variables, so from the perspective of an event listener, there is no compatible active transaction that it can participate in.

Juergen Hoeller, Oliver Drotbohm
See Also: