spring-projects / spring-projects/spring-modulith
Clarify that `@ApplicationModuleListener` is not working with `Moments`
@odrotbohm is already working on this.
Since Oct 29, 2025.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.