Skip to content

GH-1904 - Skip resubmission of publications whose event cannot be deserialized - #1905

Open
AdzerKI wants to merge 1 commit into
spring-projects:mainfrom
AdzerKI:gh-1904-undeserializable-resubmission
Open

AdzerKI wants to merge 1 commit into
spring-projects:mainfrom
AdzerKI:gh-1904-undeserializable-resubmission

Conversation

@AdzerKI

@AdzerKI AdzerKI commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1904.

DefaultEventPublicationRegistry.processPublications(…) unregistered a publication in its catch block even if registering it had failed. For a JDBC publication whose event can't be deserialized, registering already throws, and unregistering deserializes the event again, so the second exception escaped the catch block. That aborted the resubmission run and, with republish-outstanding-events-on-restart enabled, the application startup.

The catch block now only unregisters a publication that was actually registered. A publication whose event can't be deserialized is logged like any other failed resubmission, and the remaining publications of the run are still resubmitted.

Covered by a new test in DefaultEventPublicationRegistryUnitTests, the spring-modulith-events-core test suite passes.

…t cannot be deserialized.

A publication whose event fails to deserialize throws when registered as in progress. Unregistering it in the catch block deserialized the event again and let that exception escape, which aborted the resubmission and, with republish-outstanding-events-on-restart enabled, the application startup. We now only unregister publications that were actually registered.

Signed-off-by: AdzerKI <silver_cat@list.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resubmitting a publication whose event cannot be deserialized fails application startup

1 participant