Table of Contents

Class OutboundRouterBehavior

Namespace
Silverback.Messaging.Producing.Routing
Assembly
Silverback.Integration.dll

Routes the messages to the producer by wrapping them in an IOutboundEnvelope<TMessage> that is republished to the bus.

public class OutboundRouterBehavior : IBehavior, ISorted
Inheritance
OutboundRouterBehavior
Implements
Inherited Members

Constructors

OutboundRouterBehavior(IMessageWrapper, IProducerCollection)

Initializes a new instance of the OutboundRouterBehavior class.

public OutboundRouterBehavior(IMessageWrapper messageWrapper, IProducerCollection producers)

Parameters

messageWrapper IMessageWrapper

The IMessageWrapper.

producers IProducerCollection

The IProducerCollection.

Properties

SortIndex

Gets the sort index.

public int SortIndex { get; }

Property Value

int

Methods

HandleAsync(IPublisher, object, MessageHandler, CancellationToken)

Process, handles or transforms the messages being published via the message bus.

public ValueTask<IReadOnlyCollection<object?>> HandleAsync(IPublisher publisher, object message, MessageHandler next, CancellationToken cancellationToken)

Parameters

publisher IPublisher

The IPublisher that is publishing the message.

message object

The message being published.

next MessageHandler

The next behavior in the pipeline.

cancellationToken CancellationToken

The CancellationToken that can be used to cancel the operation.

Returns

ValueTask<IReadOnlyCollection<object>>

A ValueTask<TResult> representing the asynchronous operation. The task result contains the result values (if any).