Interface IMessageDispatcher
Strategy interface for dispatching messages to handlers.
Namespace: Steeltoe.Integration.Dispatcher
Assembly: Steeltoe.Integration.Abstractions.dll
Syntax
public interface IMessageDispatcher
Properties
| Edit this page View SourceFailover
Gets or sets a value indicating whether this dispatcher should failover upon a dispatching error
Declaration
bool Failover { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HandlerCount
Gets the current handler count
Declaration
int HandlerCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
LoadBalancingStrategy
Gets or sets the load balancing strategy in use by the dispatcher
Declaration
ILoadBalancingStrategy LoadBalancingStrategy { get; set; }
Property Value
Type | Description |
---|---|
ILoadBalancingStrategy |
MaxSubscribers
Gets or sets the maximum number of subscribers this dispatcher supports
Declaration
int MaxSubscribers { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MessageHandlingDecorator
Gets or sets the message handling decorator that should be applied to the message for processing
Declaration
IMessageHandlingDecorator MessageHandlingDecorator { get; set; }
Property Value
Type | Description |
---|---|
IMessageHandlingDecorator |
Methods
| Edit this page View SourceAddHandler(IMessageHandler)
Adds a handler to the dispatcher
Declaration
bool AddHandler(IMessageHandler handler)
Parameters
Type | Name | Description |
---|---|---|
IMessageHandler | handler | the handler to add |
Returns
Type | Description |
---|---|
System.Boolean | true if added |
Dispatch(IMessage, CancellationToken)
Dispatch the message to one or more handlers
Declaration
bool Dispatch(IMessage message, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
IMessage | message | the message to dispatch |
CancellationToken | cancellationToken | token used to cancel the operation |
Returns
Type | Description |
---|---|
System.Boolean | the value returned from the handler |
RemoveHandler(IMessageHandler)
Remove the specified handler from the dispatcher
Declaration
bool RemoveHandler(IMessageHandler handler)
Parameters
Type | Name | Description |
---|---|---|
IMessageHandler | handler | the handler to remove |
Returns
Type | Description |
---|---|
System.Boolean | true if removed |