spring-projects / spring-projects/spring-modulith

Allow differentiating between failed event publications and ones that are currently processed

Open
#663 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: event publication registry type: enhancement
Dominant language
Java
Stars
1.2k
Forks
222
PR merge metrics
No merged PRs in 30d

Description

Hi,

we ran into another issue with multiple nodes (using jpa event publication), where one node tries to handle the event via the local application event publishing mechanism, whilst the other node tries to replay incompleted event (because it has not been marked as completed yet).
For now we mitigated the issue, by only replying events older than x seconds to avoid the same event handler to be triggered twice on different nodes.
I wonder, if it would be useful that any event handler either keeps a lock in the database while processing an event or uses a state field (wether the event is currently being processed).

What would be your recommendation?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the JPA event publication and incomplete-event replay paths described in the issue, including how multiple nodes select and mark publications. Compare database locking with a processing state, then clarify the intended behavior for concurrent handlers and replay timing. Done requires a decided recommendation or implementation scope that prevents duplicate handling across nodes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.