pub struct DefaultRouteErrorHandler { /* private fields */ }Expand description
Default implementation of RouteErrorHandler. Owns DLC producer exclusively. Encapsulates retry/onException/DLC logic.
Uses SyncBoxProcessor internally so the handler is Send + Sync as required
by the RouteErrorHandler trait.
Implementations§
Source§impl DefaultRouteErrorHandler
impl DefaultRouteErrorHandler
pub fn new( dlc_producer: Option<BoxProcessor>, policies: Vec<(ExceptionPolicy, Option<BoxProcessor>)>, ) -> Self
Trait Implementations§
Source§impl RouteErrorHandler for DefaultRouteErrorHandler
impl RouteErrorHandler for DefaultRouteErrorHandler
Source§fn match_policy(&self, err: &CamelError) -> Option<PolicyId>
fn match_policy(&self, err: &CamelError) -> Option<PolicyId>
Match a policy for the given error. Called once before retry.
Source§fn retry_step<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: Option<PolicyId>,
step: &'life1 mut BoxProcessor,
original: Exchange,
error: CamelError,
) -> Pin<Box<dyn Future<Output = RetryOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn retry_step<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: Option<PolicyId>,
step: &'life1 mut BoxProcessor,
original: Exchange,
error: CamelError,
) -> Pin<Box<dyn Future<Output = RetryOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Phase 1: Retry the failed step.
Source§fn handle_step<'life0, 'async_trait>(
&'life0 self,
policy: Option<PolicyId>,
exchange: Exchange,
error: CamelError,
) -> Pin<Box<dyn Future<Output = Result<StepDisposition, CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_step<'life0, 'async_trait>(
&'life0 self,
policy: Option<PolicyId>,
exchange: Exchange,
error: CamelError,
) -> Pin<Box<dyn Future<Output = Result<StepDisposition, CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Phase 2: Determine step disposition after retry exhaustion.
Source§fn handle_boundary<'life0, 'async_trait>(
&'life0 self,
_kind: BoundaryKind,
exchange: Exchange,
error: CamelError,
) -> Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_boundary<'life0, 'async_trait>(
&'life0 self,
_kind: BoundaryKind,
exchange: Exchange,
error: CamelError,
) -> Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle boundary (infrastructure) errors.
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultRouteErrorHandler
impl !UnwindSafe for DefaultRouteErrorHandler
impl Freeze for DefaultRouteErrorHandler
impl Send for DefaultRouteErrorHandler
impl Sync for DefaultRouteErrorHandler
impl Unpin for DefaultRouteErrorHandler
impl UnsafeUnpin for DefaultRouteErrorHandler
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