spring-projects / spring-projects/spring-modulith
Automatic Retry Scheduler for FAILED Events (Complement to Staleness Monitor)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Feature Request: Automatic Retry Scheduler for FAILED Events
Requested: Add configurable automatic retry scheduler that leverages the new v2 schema infrastructure (completion_attempts, explicit states, multi-instance safety).
Context
Spring Modulith 2.0 M1 introduced:
- Staleness monitor (detects stuck events, marks as FAILED) ✅
- Completion attempts tracking ✅
- Multi-instance safety ✅
Missing piece: Automatic retry of FAILED events
Current Behavior
- Event fails or gets stuck → Staleness monitor marks as FAILED ✅
- Event remains in FAILED state forever ❌
- Manual intervention required to retry ❌
Requested Feature
Add configurable retry scheduler:
spring:
modulith:
events:
staleness:
enabled: true
processing-timeout: 5m
# NEW: Automatic retry configuration
retry:
enabled: true
fixed-delay: 60s
max-attempts: 10 # ← Uses completion_attempts
max-age: 7d # ← Age-based limit
batch-size: 100
states-to-retry:
- FAILED # ← Retry events marked by staleness monitor
- PUBLISHED # ← Retry immediate failures
How It Would Work
- External system fails → Event marked FAILED by staleness monitor
- Retry scheduler (every 60s):
- Queries events in FAILED state
- Filters by completion_attempts < 10
- Filters by age < 7 days
- Changes state to RESUBMITTED
- Republishes events
- If successful → State changes to COMPLETED
- If fails again → completion_attempts++, back to FAILED
- After 10 attempts or 7 days → Marked as BLOCKED
Propoesed state diagram-
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing staleness monitor, completion_attempts tracking, explicit event states, and multi-instance safety described in the issue; no source files or tests are named. Done means a configurable scheduler retries eligible FAILED or PUBLISHED events, enforces attempt and age limits, republishes them safely, and marks exhausted events BLOCKED.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100