Class Exchange
Default implementation of IExchange.
In is always present, Out is lazy (null by default for InOnly routes).
public class Exchange : IExchange, IAsyncDisposable
Inheritance
Implements
Properties
Context
The route context currently processing this exchange (Apache Camel's
public IRouteContext? Context { get; }
ExceptionHandled
Whether the current exception has been handled by error handling logic.
public bool ExceptionHandled { get; set; }
ExchangeId
Unique identifier of this exchange instance, generated at creation.
public string ExchangeId { get; }
Properties
Route-level metadata (RouteId, TRANSACT_ACTION, etc.).
public IDictionary<string, object?> Properties { get; }
ServiceProvider
Optional scoped service provider bound to this exchange's lifetime.
public IServiceProvider? ServiceProvider { get; }
Methods
Clone()
Structural copy of the exchange (In, Out, Properties containers + a fresh DI scope). The
public IExchange Clone()
CloneLinked()
Creates a deep copy of the exchange that shares the parent's DI scope (no new scope).
public IExchange CloneLinked()
Create(IMessage, IServiceScopeFactory?)
Creates an exchange, optionally with a per-exchange DI scope.
public static Exchange Create(IMessage message, IServiceScopeFactory? scopeFactory)
CreateChild(IMessage)
Creates a child exchange with the given message, inheriting Properties, RouteId,
public IExchange CreateChild(IMessage message)
CreateLinkedChild(IMessage)
Creates a child exchange that shares the parent's DI scope (no new scope).
public IExchange CreateLinkedChild(IMessage message)
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or
public ValueTask DisposeAsync()
GetProperty<T>(string)
Gets a property value with type conversion.
public T? GetProperty<T>(string key)
ReleaseScopes()
Releases DI scopes (main scope + named __redb_scope:* entries) and the resources registered with
public ValueTask ReleaseScopes()
Snapshot()
Deep, isolated snapshot for checkpoint/replay. Unlike it deep-copies
public IExchange Snapshot()
Constructors
Exchange()
Creates an exchange with a new empty In message.
Exchange(IMessage, IServiceScopeFactory)
Creates an exchange with DI scope support.
Exchange(IMessage)
Creates an exchange with the specified In message.