Closed as not planned
Closed as not planned
Description
Affects: Spring Boot 2.2.0.M3
If we publish the events within the transactional reactive methods, for example:
@Transactional
public Mono<Model> create(Model model, ModelEvent.Type type) {
return repo.save(model)
.doOnSuccess(m -> publisher.publishEvent(new ModelEvent(m, type)));
}
then the 'event listener' method with @TransactionalEventListener
is not invoked (regardless of whether the @Async
annotation is used or not):
// @Async
@TransactionalEventListener(condition = "#event.inTransactionEventListener()")
public void handleEventInTransactionEventListener(ModelEvent event) {
log.info("[i] Handled event: {}, in transactional event listener", event.getModel());
}
Related demo is here.