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
HandlerCount
Gets the current handler count
int HandlerCount { get; }
Property Value
LoadBalancingStrategy
Gets or sets the load balancing strategy in use by the dispatcher
ILoadBalancingStrategy LoadBalancingStrategy { get; set; }
Property Value
MaxSubscribers
Gets or sets the maximum number of subscribers this dispatcher supports
int MaxSubscribers { get; set; }
Property Value
MessageHandlingDecorator
Gets or sets the message handling decorator that should be applied to the message for processing
IMessageHandlingDecorator MessageHandlingDecorator { get; set; }
Property Value
Methods
AddHandler(IMessageHandler)
Adds a handler to the dispatcher
bool AddHandler(IMessageHandler handler)
Parameters
handler
IMessageHandlerthe 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
IMessagethe message to dispatch
cancellationToken
CancellationTokentoken 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
IMessageHandlerthe handler to remove
Returns
- bool
true if removed