A configured publication registry can retain unfinished transactional-listener work, but it cannot itself prove downstream acceptance.
Spring Modulith event registry recovery: separate publication, listener and broker states
Persist the intended listener work
With a supported registry starter and database schema, a transactional event publication can be recorded with the originating business transaction. A listener that fails leaves publication state available for a configured resubmission path. Test the same event identifier through failure, process restart and recovery. The current source kit does not install a registry starter or run this experiment.
Do not flatten the states
An event may be published, in progress, failed, resubmitted or completed locally. A completed local listener can still hand a message to an external broker whose own acknowledgement and consumer processing are separate facts. An outbox is another way to record external intent; neither design removes the need for consumer idempotency.
Bound replay and retention
Set retry age, attempt budget and a terminal operator path. Keep completed publication records only as long as audit needs require. If a listener updates another store, use a stable event ID so resubmission does not apply the mutation twice.
Boundary sketch
// Persist business change and publication intent in one transaction.
// On restart, resubmit only eligible unfinished listener work.
// Verify broker and consumer outcomes as separate contracts.Cost and verification
Registry persistence adds a write per listener publication and maintenance for failed and completed rows. Recovery testing requires a durable database and process restart. This design remains unexecuted in the source kit.
Common Mistakes
- Do not equate a registry row with Kafka acceptance.
- Do not resubmit indefinitely without an operator path.
- Do not claim this design sketch is tested by the in-memory module slice.
Read next
Spring Modulith PublishedEvents: assert an accepted fact and a rejected silence, Spring Modulith events: publish a domain fact after a valid state change, Spring transactional outbox: commit a receipt and event row together, Spring consumer deduplication: commit the event ID with the mutation.
