Skip to content

Commit 8fa9bc5

Browse files
committed
GH-1083 - Only unregister resubmitted event publication in case of errors.
Before this commit the code resubmitting incomplete event publications unregistered them independently of whether they succeeded or not. We now only do that for failed submissions as an error here indicates a failure to *submit* the publication. As the execution is likely performed asynchronously, a successful hand-off does not implicate the publication being completely processed.
1 parent f61e7d9 commit 8fa9bc5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/core/DefaultEventPublicationRegistry.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,11 @@ public void processIncompletePublications(Predicate<EventPublication> filter,
218218

219219
} catch (Exception o_O) {
220220

221+
inProgress.unregister(it);
222+
221223
if (LOGGER.isInfoEnabled()) {
222224
LOGGER.info("Error republishing event publication %s.".formatted(it), o_O);
223225
}
224-
225-
} finally {
226-
inProgress.unregister(it);
227226
}
228227
});
229228
}

0 commit comments

Comments
 (0)