Message identity and lifecycle
Nereus Delay uses different identities for different retry and concurrency questions. Treating them as one ID would make deduplication and stale-result handling ambiguous.
Identity layers
| Identity | Stable across | Changes when | Protects against |
|---|---|---|---|
commandId + commandHash | Physical retries of one logical Command | A new business operation is prepared | Re-enqueue ambiguity and conflicting reuse of a Command ID |
delayMessageId | Schedule, Cancel, Reschedule, and delivery lifecycle | A different logical delayed message is created | Accidental replacement of an existing message |
generation | One scheduling version of a message | Reschedule creates a new version | A stale callback or retry changing the current version |
| Attempt identity | One admitted destination side effect | A new attempt is durably admitted | Mixing evidence from different publish attempts |
The same commandId with the same hash is an idempotent retry. The same commandId with different command semantics is a conflict. Idempotency is bounded by source-ordered time fences rather than a local wall-clock cleanup guess.
Message lifecycle
This diagram is a reader model. The runtime also maintains internal bookkeeping for attempts, evidence, retention, and recovery.
Why Reschedule creates a generation
Reschedule does not mutate a producer callback already in flight. Instead, it creates a new generation with a new delivery window. Any old Claim, Attempt, or callback still names the earlier generation and cannot silently overwrite the current one.
The destination may still observe an older attempt if it had already crossed durable Publish Admission. That is why the service reports evidence and uncertainty instead of describing every late result as a clean cancellation.
Terminal does not always mean immediately deletable
Terminal message state, command results, payload references, receipts, and compact identity tombstones have separate retention duties. Recovery Floor and source time-fence rules decide when older state can no longer be needed by an allowed checkpoint or a late retry.
Continue with Cancel and reschedule and delivery guarantees and uncertainty.