pub struct Exchange {
pub input: Message,
pub output: Option<Message>,
pub properties: HashMap<String, Value>,
pub error: Option<CamelError>,
pub pattern: ExchangePattern,
pub correlation_id: String,
}Expand description
An Exchange represents a message being routed through the framework.
It contains the input message, an optional output message, properties for passing data between processors, and error state.
Fields§
§input: MessageThe input (incoming) message.
output: Option<Message>The output (response) message, populated for InOut patterns.
properties: HashMap<String, Value>Exchange-scoped properties for passing data between processors.
error: Option<CamelError>Error state, if processing failed.
pattern: ExchangePatternThe exchange pattern.
correlation_id: StringUnique correlation ID for distributed tracing.
Implementations§
Source§impl Exchange
impl Exchange
Sourcepub fn new_in_out(input: Message) -> Self
pub fn new_in_out(input: Message) -> Self
Create a new exchange with the InOut pattern.
Sourcepub fn correlation_id(&self) -> &str
pub fn correlation_id(&self) -> &str
Get the correlation ID for this exchange.
Sourcepub fn set_property(&mut self, key: impl Into<String>, value: impl Into<Value>)
pub fn set_property(&mut self, key: impl Into<String>, value: impl Into<Value>)
Set a property value.
Sourcepub fn set_error(&mut self, error: CamelError)
pub fn set_error(&mut self, error: CamelError)
Set an error on this exchange.
Trait Implementations§
Source§impl Service<Exchange> for IdentityProcessor
impl Service<Exchange> for IdentityProcessor
Source§type Error = CamelError
type Error = CamelError
Errors produced by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send>>
The future response value.
Source§impl<F, Fut> Service<Exchange> for ProcessorFn<F>
impl<F, Fut> Service<Exchange> for ProcessorFn<F>
Source§type Error = CamelError
type Error = CamelError
Errors produced by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send>>
The future response value.
Auto Trait Implementations§
impl !Freeze for Exchange
impl RefUnwindSafe for Exchange
impl Send for Exchange
impl Sync for Exchange
impl Unpin for Exchange
impl UnsafeUnpin for Exchange
impl UnwindSafe for Exchange
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