Skip to content

Document that @TransactionalEventListener is not supported with ReactiveTransactionManager #23127

Closed as not planned
@Cepr0

Description

@Cepr0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: dataIssues in data modules (jdbc, orm, oxm, tx)status: duplicateA duplicate of another issuetype: documentationA documentation task

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions