Skip to content

Block for externalization in outbox mode#1687

Closed
rolandbeisel wants to merge 1 commit into
spring-projects:mainfrom
rolandbeisel:fix/namastack-outbox-sync
Closed

Block for externalization in outbox mode#1687
rolandbeisel wants to merge 1 commit into
spring-projects:mainfrom
rolandbeisel:fix/namastack-outbox-sync

Conversation

@rolandbeisel
Copy link
Copy Markdown
Contributor

Fix synchronous handling for Outbox event externalization across transport configurations

Summary

This PR ensures that Outbox event externalization is handled synchronously across all supported messaging transport modules (AMQP, JMS, Kafka, and Spring Messaging). The Outbox handler implementations now block until the externalization is complete and properly propagate exceptions.

Details

  • Modules affected:

    • spring-modulith-events-amqp
    • spring-modulith-events-jms
    • spring-modulith-events-kafka
    • spring-modulith-events-messaging
  • What was changed:

    • The Outbox handler in each transport configuration now calls .get() on the returned CompletableFuture to ensure synchronous execution.
    • Exceptions (InterruptedException, ExecutionException) are caught and rethrown as RuntimeException, with the thread interrupt status restored as appropriate.
    • This guarantees that failures during event externalization are not silently ignored and are surfaced to the caller.

Why

  • To provide consistent, reliable, and predictable event externalization semantics across all messaging modules.
  • To ensure that errors during outbox processing are not lost and can be handled by the application.

…sport configurations

Signed-off-by: Roland Beisel <info@rolandbeisel.de>
@odrotbohm odrotbohm self-assigned this May 18, 2026
@odrotbohm odrotbohm added in: event publication registry Event publication registry type: improvement Minor improvements labels May 18, 2026
@odrotbohm odrotbohm added this to the 2.1 GA milestone May 18, 2026
@odrotbohm odrotbohm changed the title Fix synchronous handling for Outbox event externalization Block for externalization in outbox mode May 18, 2026
odrotbohm added a commit that referenced this pull request May 18, 2026
To ensure proper ordering of messages externalized via the outbox, we now block the generic execution that returns a CompletableFuture.

Co-Authored-By: Roland Beisel <info@rolandbeisel.de>
@odrotbohm
Copy link
Copy Markdown
Member

Tweaked as discussed 1:1.

@odrotbohm odrotbohm closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: event publication registry Event publication registry type: improvement Minor improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants