pub struct DefaultRouteErrorHandler {
pub use_original_message: bool,
/* 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.
Fields§
§use_original_message: boolWhen true, restore the original Message (body and headers, pre-route, pre-mutation)
before forwarding to the DLC/handler. The original message is stashed by
RouteChannelService::call as the ORIGINAL_MESSAGE_EXTENSION extension.
Implementations§
Source§impl DefaultRouteErrorHandler
impl DefaultRouteErrorHandler
pub fn new( dlc_producer: Option<BoxProcessor>, policies: Vec<(ExceptionPolicy, Option<BoxProcessor>)>, ) -> Self
Sourcepub fn with_use_original_message(self, enabled: bool) -> Self
pub fn with_use_original_message(self, enabled: bool) -> Self
Enable restoration of the original message before forwarding to DLC.
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 dyn RetryableStep,
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 dyn RetryableStep,
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