-
Notifications
You must be signed in to change notification settings - Fork 178
Open
Labels
in: event publication registryEvent publication registryEvent publication registrymeta: waiting for feedbackWaiting for feedback of the original reporterWaiting for feedback of the original reportertype: improvementMinor improvementsMinor improvements
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 failuresHow 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-

Metadata
Metadata
Assignees
Labels
in: event publication registryEvent publication registryEvent publication registrymeta: waiting for feedbackWaiting for feedback of the original reporterWaiting for feedback of the original reportertype: improvementMinor improvementsMinor improvements