Class OutboxMessageMapper
Default implementation of IOutboxMessageMapper that integrates the outbox pattern with the message mapping system.
public sealed class OutboxMessageMapper : IOutboxMessageMapper
- Inheritance
-
OutboxMessageMapper
- Implements
- Inherited Members
- Extension Methods
Remarks
This mapper bridges outbound messages from the outbox store with the transport message mapping infrastructure. It creates transport contexts from outbound messages and applies configured mappings for target transports.
Constructors
OutboxMessageMapper(IMessageMapper?, IMessageMapperRegistry?, IMessageRoutingConfiguration?)
Initializes a new instance of the OutboxMessageMapper class.
public OutboxMessageMapper(IMessageMapper? messageMapper = null, IMessageMapperRegistry? mapperRegistry = null, IMessageRoutingConfiguration? routingConfiguration = null)
Parameters
messageMapperIMessageMapperOptional message mapper for transport transformations.
mapperRegistryIMessageMapperRegistryOptional mapper registry for specific transport combinations.
routingConfigurationIMessageRoutingConfigurationOptional routing configuration for multi-transport routing.
Methods
CreateContext(OutboundMessage, string)
Creates a transport message context from an outbound message.
public ITransportMessageContext CreateContext(OutboundMessage message, string targetTransport)
Parameters
messageOutboundMessageThe outbound message from the outbox.
targetTransportstringThe target transport name.
Returns
- ITransportMessageContext
A transport message context configured for the target transport.
GetTargetTransports(string)
Gets the target transports for a given message type.
public IReadOnlyCollection<string> GetTargetTransports(string messageType)
Parameters
messageTypestringA type name for the message that the message type registry can resolve — its simple name, its assembly-qualified name, or "Namespace.TypeName, AssemblyName".
Returns
- IReadOnlyCollection<string>
A collection of target transport names, or empty if using default routing.
MapToTransport(OutboundMessage, ITransportMessageContext, string)
Maps an outbound message to a transport-specific context using configured mappings.
public ITransportMessageContext MapToTransport(OutboundMessage message, ITransportMessageContext sourceContext, string targetTransport)
Parameters
messageOutboundMessageThe outbound message from the outbox.
sourceContextITransportMessageContextThe source transport context.
targetTransportstringThe target transport name.
Returns
- ITransportMessageContext
A transport message context mapped for the target transport.