Interface IExchange
Represents a message exchange in the route pipeline.
Contains In message (always present), optional Out message (lazy),
exchange pattern, route-level properties, and error state.
Supports both C# idiomatic properties and Java-style methods.
public interface IExchange : IAsyncDisposable
Properties
Context
The route context currently processing this exchange (Apache Camel's
IRouteContext? Context { get; }
ExceptionHandled
Whether the current exception has been handled by error handling logic.
bool ExceptionHandled { get; set; }
ExchangeId
Unique identifier of this exchange instance, generated at creation.
string ExchangeId { get; }
Properties
Route-level metadata (RouteId, TRANSACT_ACTION, etc.).
IDictionary<string, object?> Properties { get; }
ServiceProvider
Optional scoped service provider bound to this exchange's lifetime.
IServiceProvider? ServiceProvider { get; }
Methods
Clone()
Structural copy of the exchange (In, Out, Properties containers + a fresh DI scope). The
IExchange Clone()
CloneLinked()
Creates a deep copy of the exchange that shares the parent's DI scope (no new scope).
IExchange CloneLinked()
CreateChild(IMessage)
Creates a child exchange with the given message, inheriting Properties, RouteId,
IExchange CreateChild(IMessage message)
CreateLinkedChild(IMessage)
Creates a child exchange that shares the parent's DI scope (no new scope).
IExchange CreateLinkedChild(IMessage message)
ReleaseScopes()
Releases DI scopes (main scope + named __redb_scope:* entries) and the resources registered with
ValueTask ReleaseScopes()
setProperty(string, object?)
Java-style: sets property value.
void setProperty(string key, object? value)