From 3aa6a12b218845e69c9fdc95e4e8b5490423309b Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Mon, 4 Sep 2023 09:46:33 +0200 Subject: [PATCH] GH-288 - Clarify event republication behavior on restart. --- src/docs/asciidoc/40-events.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/docs/asciidoc/40-events.adoc b/src/docs/asciidoc/40-events.adoc index 769a85d3..3e6bad1f 100644 --- a/src/docs/asciidoc/40-events.adoc +++ b/src/docs/asciidoc/40-events.adoc @@ -117,7 +117,9 @@ image::event-publication-registry-start.png[] Each transactional event listener is wrapped into an aspect that marks that log entry as completed if the execution of the listener succeeds. In case the listener fails, the log entry stays untouched so that retry mechanisms can be deployed depending on the application's needs. -By default, all incomplete event publications are resubmitted at application startup. +Automatic republication on application restart can be enabled by setting the `spring.modulith.republish-outstanding-events-on-restart` property to `true`. +Note, that this is only recommended for single-instance application deployments. +For a more flexible arrangement, `EventPublicationRegistry` exposes a method `….findIncompletePublications()` that can be called from user code. .The transactional event listener arrangement after execution image::event-publication-registry-end.png[]