Class OutboundRouterBehavior
Routes the messages to the producer by wrapping them in an IOutboundEnvelope<TMessage> that is republished to the bus.
Inherited Members
Namespace: Silverback.Messaging.Producing.Routing
Assembly: Silverback.Integration.dll
Syntax
public class OutboundRouterBehavior : IBehavior, ISorted
Constructors
OutboundRouterBehavior(IMessageWrapper, IProducerCollection)
Initializes a new instance of the OutboundRouterBehavior class.
Declaration
public OutboundRouterBehavior(IMessageWrapper messageWrapper, IProducerCollection producers)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageWrapper | messageWrapper | The IMessageWrapper. |
| IProducerCollection | producers | The IProducerCollection. |
Properties
SortIndex
Gets the sort index.
Declaration
public int SortIndex { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
HandleAsync(IPublisher, object, MessageHandler, CancellationToken)
Process, handles or transforms the messages being published via the message bus.
Declaration
public ValueTask<IReadOnlyCollection<object?>> HandleAsync(IPublisher publisher, object message, MessageHandler next, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublisher | publisher | The IPublisher that is publishing the message. |
| object | message | The message being published. |
| MessageHandler | next | The next behavior in the pipeline. |
| CancellationToken | cancellationToken | The CancellationToken that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| ValueTask<IReadOnlyCollection<object>> | A ValueTask<TResult> representing the asynchronous operation. The task result contains the result values (if any). |