spring-projects / spring-projects/spring-modulith

Legacy incomplete events not resubmitted properly

Open
#1,565 2 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Sep 18, 2026.

in: event publication registry type: bug
Dominant language
Java
Stars
1.2k
Forks
222
PR merge metrics
No merged PRs in 30d

Description

I have enabled spring.modulith.events.republish-outstanding-events-on-restart = true
Events are registered in event_publication and remain with completion_date = null
When application restarts I see logged message:

2026-02-13T09:03:46.166+02:00 DEBUG 43792 --- [send] [omcat-handler-1] .s.m.e.c.DefaultEventPublicationRegistry : Looking up incomplete event publications … 
2026-02-13T09:03:46.383+02:00 DEBUG 43792 --- [send] [omcat-handler-1] .s.m.e.c.DefaultEventPublicationRegistry : 16 publications found.

But events listeners are not called. After checking the sources I see that there is a call in /DefaultEventPublicationRegistry.java to processPublications(publications, filter, consumer); which when followed leads to:

private void processPublications(Collection<TargetEventPublication> publications, Predicate<EventPublication> filter,
			Consumer<TargetEventPublication> consumer) {

		publications.stream() //
				.filter(filter) //
				.forEach(it -> {

I assume that the filter is not passed by, because there are no logs for LOGGER.debug("Resubmitting event publication %s.".formatted(it.getIdentifier()));

I also tried calling publications.resubmitIncompletePublications(ep -> true); from a controller after the app fully started, but events listeners are not called again.

I am using JPA to store publications. The database table exists and is populated with new events. Fields completion_attempts, last_resubmission_date and status are empty. Enabling SQL log shows no attempts to update them (only the select query).

When I tried to change listener_id I see error logs that the relevant listener is not found, which means code properly selects rows and determines relevant listener. but the listener itself is not triggered (no debug output nor job is done from inside of it).

I would highly appreciate any help in how to republish all events after application restart.

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.