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.
The sync arm returns None when no key can be extracted — in that case
the segment forwards the exchange to the child sub-pipeline without
idempotency (matching Apache Camel semantics). 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 Freeze 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