Table of Contents

Interface IMessageDispatcher

Namespace
Steeltoe.Integration.Dispatcher
Assembly
Steeltoe.Integration.Abstractions.dll

Strategy interface for dispatching messages to handlers.

public interface IMessageDispatcher

Properties

Failover

Gets or sets a value indicating whether this dispatcher should failover upon a dispatching error

bool Failover { get; set; }

Property Value

bool

HandlerCount

Gets the current handler count

int HandlerCount { get; }

Property Value

int

LoadBalancingStrategy

Gets or sets the load balancing strategy in use by the dispatcher

ILoadBalancingStrategy LoadBalancingStrategy { get; set; }

Property Value

ILoadBalancingStrategy

MaxSubscribers

Gets or sets the maximum number of subscribers this dispatcher supports

int MaxSubscribers { get; set; }

Property Value

int

MessageHandlingDecorator

Gets or sets the message handling decorator that should be applied to the message for processing

IMessageHandlingDecorator MessageHandlingDecorator { get; set; }

Property Value

IMessageHandlingDecorator

Methods

AddHandler(IMessageHandler)

Adds a handler to the dispatcher

bool AddHandler(IMessageHandler handler)

Parameters

handler IMessageHandler

the handler to add

Returns

bool

true if added

Dispatch(IMessage, CancellationToken)

Dispatch the message to one or more handlers

bool Dispatch(IMessage message, CancellationToken cancellationToken = default)

Parameters

message IMessage

the message to dispatch

cancellationToken CancellationToken

token used to cancel the operation

Returns

bool

the value returned from the handler

RemoveHandler(IMessageHandler)

Remove the specified handler from the dispatcher

bool RemoveHandler(IMessageHandler handler)

Parameters

handler IMessageHandler

the handler to remove

Returns

bool

true if removed