pub enum MessageIdSource {
Sync(Arc<dyn Fn(&Exchange) -> Option<String> + Send + Sync>),
Async(Arc<dyn Fn(&Exchange) -> BoxValueFuture + Send + Sync>),
}Expand description
Fallible message-id source for the idempotent consumer.
An absent key — None from the sync arm, or null/empty from the async arm —
is resolved by the segment’s OnMissingKey policy: it is never silently
forwarded. This deliberately drops Apache Camel parity, where a keyless
exchange bypasses idempotency silently (ADR-0099). The async arm may fail
with a camel_api::CamelError; the failure fails the step before the
child runs. Non-scalar values (array/object) are rejected.
Variants§
Sync(Arc<dyn Fn(&Exchange) -> Option<String> + Send + Sync>)
Programmatic synchronous extractor.
Async(Arc<dyn Fn(&Exchange) -> BoxValueFuture + Send + Sync>)
Language-backed asynchronous expression.
Implementations§
Source§impl MessageIdSource
impl MessageIdSource
Sourcepub async fn message_id(
&self,
exchange: &Exchange,
) -> Result<Option<String>, CamelError>
pub async fn message_id( &self, exchange: &Exchange, ) -> Result<Option<String>, CamelError>
Extract the optional message id, propagating async failures.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MessageIdSource
impl !UnwindSafe for MessageIdSource
impl Forget for MessageIdSource
impl Freeze for MessageIdSource
impl Move for MessageIdSource
impl Send for MessageIdSource
impl Sync for MessageIdSource
impl Unpin for MessageIdSource
impl UnsafeUnpin for MessageIdSource
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