Class DictionaryOutboundRouter<TMessage, TEndpoint>
Routes the outbound messages to one or multiple endpoints.
Inherited Members
Namespace: Silverback.Messaging.Outbound.Routing
Assembly: Silverback.Integration.dll
Syntax
public class DictionaryOutboundRouter<TMessage, TEndpoint> : OutboundRouter<TMessage>, IOutboundRouter<TMessage>, IOutboundRouter where TEndpoint : IProducerEndpoint
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be routed. |
TEndpoint | The type of the IProducerEndpoint. |
Constructors
| Improve this doc View sourceDictionaryOutboundRouter(RouterFunction, IReadOnlyDictionary<string, TEndpoint>)
Initializes a new instance of the DictionaryOutboundRouter<TMessage, TEndpoint> class.
Declaration
public DictionaryOutboundRouter(DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction routerFunction, IReadOnlyDictionary<string, TEndpoint> endpoints)
Parameters
Type | Name | Description |
---|---|---|
DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction | routerFunction | The DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction. |
IReadOnlyDictionary<string, TEndpoint> | endpoints | The IReadOnlyDictionary<TKey, TValue> containing the endpoints and their key. |
DictionaryOutboundRouter(SingleEndpointRouterFunction, IReadOnlyDictionary<string, TEndpoint>)
Initializes a new instance of the DictionaryOutboundRouter<TMessage, TEndpoint> class.
Declaration
public DictionaryOutboundRouter(DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction routerFunction, IReadOnlyDictionary<string, TEndpoint> endpoints)
Parameters
Type | Name | Description |
---|---|---|
DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction | routerFunction | The DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction. |
IReadOnlyDictionary<string, TEndpoint> | endpoints | The IReadOnlyDictionary<TKey, TValue> containing the endpoints and their key. |
Properties
| Improve this doc View sourceEndpoints
Gets the endpoints that are potentially targeted by this router. This collection could be built over time in case of a dynamic IOutboundRouter but that will prevent the IOutboxWorker to work properly and it's not optimal as it used for example by the health checks to ping all possible endpoints.
Declaration
public override IEnumerable<IProducerEndpoint> Endpoints { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IProducerEndpoint> |
Overrides
Methods
| Improve this doc View sourceGetDestinationEndpoints(TMessage, MessageHeaderCollection)
Returns the collection of IProducerEndpoint representing the endpoints where the specified message must be produced.
Declaration
public override IEnumerable<IProducerEndpoint> GetDestinationEndpoints(TMessage message, MessageHeaderCollection headers)
Parameters
Type | Name | Description |
---|---|---|
TMessage | message | The message to be routed. |
MessageHeaderCollection | headers | The message headers collection. |
Returns
Type | Description |
---|---|
IEnumerable<IProducerEndpoint> | The endpoints to route the message to. |