spring-projects / spring-projects/spring-modulith

Clarify that `@ApplicationModuleListener` is not working with `Moments`

Open
#1,431 5 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Oct 29, 2025.

in: reference documentation type: improvement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.