Skip to main content

Notification Retry Pipeline

Summary

Retry is an in-process, bounded exponential-backoff loop owned by RetryPolicy and driven by the dispatcher. There is no persisted retry queue and no scheduled re-drive; all attempts for a message happen within one delivery call.

Backoff schedule

Policy

RetryPolicy.MaxAttempts is the configured maximum with a floor of one. DelayFor(attempt) returns zero for attempt one and, thereafter, BaseDelayMs * BackoffFactor^(attempt-2). Defaults are three attempts, a 200 ms base delay and a factor of two. The policy is a singleton; the dispatcher drives the loop so it can persist an attempt row per try.

Where retry runs

The loop executes inside DeliverWithRetryAsync during a single dispatch (or a single RetryMessageAsync call). Delays use Task.Delay; a cancellation during a delay stops the loop. Retries therefore consume the consumer’s message-handling scope until the message succeeds or exhausts attempts.

Dead-letter configuration

NotificationOptions defines DeadLetterExchange and DeadLetterQueue names, but the consumer declares its queue with arguments: null and does not bind a dead-letter exchange. The dead-letter names are therefore configured but not wired in the reviewed source.

Broker-level redelivery

Separately from delivery retry, an unhandled infrastructure error while processing a broker message causes the consumer to nack with requeue, so the broker redelivers the event. Idempotency then guards against duplicate processing.

Verified absence

There is no RetryProcessor, RetryService, scheduled retry job or persisted retry backlog. Automatic re-drive of already-Failed messages is not implemented; re-driving is manual via the retry endpoint.

Requires Confirmation

Production retry counts and delays, and whether the dead-letter exchange is intended to be wired, require confirmation.

Source References

  • microservices/src/notification-service/Application/RetryPolicy.cs
  • microservices/src/notification-service/Application/NotificationOptions.cs
  • microservices/src/notification-service/Application/NotificationDispatcher.cs
  • microservices/src/notification-service/Messaging/NotificationEventConsumer.cs

See Also

Keywords

Retry, exponential backoff, max attempts, dead-letter, redelivery.

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-21
  • Next review: 2026-10-21