pub struct RetryHandlerConfig {
pub max_retries: u32,
pub initial_backoff: Duration,
pub max_backoff: Duration,
pub backoff_multiplier: f64,
pub dead_letter_queue: Option<Arc<DeadLetterQueueBackend>>,
pub poison_pill_tracker: Option<Arc<PoisonPillTracker>>,
pub use_jitter: bool,
}Expand description
Configuration for the RetryHandler middleware.
Fields§
§max_retries: u32The maximum number of times a message should be retried.
initial_backoff: DurationThe initial backoff duration for the first retry.
max_backoff: DurationThe maximum backoff duration.
backoff_multiplier: f64Multiplier for exponential backoff.
dead_letter_queue: Option<Arc<DeadLetterQueueBackend>>Optional dead letter queue backend for permanently failed messages.
poison_pill_tracker: Option<Arc<PoisonPillTracker>>Optional poison pill tracker for detecting problematic messages.
use_jitter: boolWhether to add jitter to backoff delays (recommended for distributed systems).
Implementations§
Source§impl RetryHandlerConfig
impl RetryHandlerConfig
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Create a new config with custom max retries.
Sourcepub fn with_dead_letter_queue(self, dlq: Arc<DeadLetterQueueBackend>) -> Self
pub fn with_dead_letter_queue(self, dlq: Arc<DeadLetterQueueBackend>) -> Self
Set the dead letter queue for permanently failed messages.
Sourcepub fn with_poison_pill_tracker(self, tracker: Arc<PoisonPillTracker>) -> Self
pub fn with_poison_pill_tracker(self, tracker: Arc<PoisonPillTracker>) -> Self
Set the poison pill tracker for detecting problematic messages.
Sourcepub fn with_jitter(self, use_jitter: bool) -> Self
pub fn with_jitter(self, use_jitter: bool) -> Self
Enable or disable jitter (enabled by default).
Trait Implementations§
Source§impl Clone for RetryHandlerConfig
impl Clone for RetryHandlerConfig
Source§fn clone(&self) -> RetryHandlerConfig
fn clone(&self) -> RetryHandlerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RetryHandlerConfig
impl Debug for RetryHandlerConfig
Auto Trait Implementations§
impl !RefUnwindSafe for RetryHandlerConfig
impl !UnwindSafe for RetryHandlerConfig
impl Freeze for RetryHandlerConfig
impl Send for RetryHandlerConfig
impl Sync for RetryHandlerConfig
impl Unpin for RetryHandlerConfig
impl UnsafeUnpin for RetryHandlerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more