Skip to content

Clarify that @ApplicationModuleListener is not working with Moments #1431

@nkolosnjaji

Description

@nkolosnjaji

Moments event publisher is not @Transactional so @ApplicationModuleListener (which hasTransactionPhase.AFTER_COMMIT) will not be triggered when Moments events is published, there will be just logging message on shutdown:

Shutting down with the following publications left unfinished: └─ org.springframework.modulith.moments.HourHasPassed

When using (@Async) @EventListener it's working properly, but this is hard to spot it in documentation , spent couple of days debugging.

This line in documentation needs more clarification:

Application code can refer to HourHasPassed, DayHasPassed, WeekHasPassed, MonthHasPassed, QuarterHasPassed, YearHasPassed types in Spring event listeners to get notified if a certain amount of time has passed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions