Class ConfiguredMessageMapper
Message mapper that applies configured mappings from the fluent API.
public sealed class ConfiguredMessageMapper : IMessageMapper
- Inheritance
-
ConfiguredMessageMapper
- Implements
- Inherited Members
- Extension Methods
Remarks
This mapper applies type-specific and default mappings configured through IMessageMappingBuilder. It checks for type-specific configurations first, then falls back to default configurations if available.
Properties
Name
Gets the name of this mapper for registration and logging purposes.
public string Name { get; }
Property Value
- string
A unique name identifying this mapper.
SourceTransport
Gets the source transport type this mapper handles.
public string SourceTransport { get; }
Property Value
- string
The source transport name (e.g., "rabbitmq", "kafka", "*" for any).
TargetTransport
Gets the target transport type this mapper produces.
public string TargetTransport { get; }
Property Value
- string
The target transport name (e.g., "rabbitmq", "kafka", "*" for any).
Methods
CanMap(string, string)
Determines whether this mapper can handle the specified source and target transports.
public bool CanMap(string sourceTransport, string targetTransport)
Parameters
Returns
Map(ITransportMessageContext, string)
Maps a source context to a target context for cross-transport delivery.
public ITransportMessageContext Map(ITransportMessageContext source, string targetTransportName)
Parameters
sourceITransportMessageContextThe source transport message context.
targetTransportNamestringThe name of the target transport.
Returns
- ITransportMessageContext
A new context configured for the target transport.
Exceptions
- ArgumentNullException
Thrown when
sourceis null.- InvalidOperationException
Thrown when the mapper cannot handle the specified transport combination.
Map<TMessage>(ITransportMessageContext, string)
Maps a message with knowledge of its concrete type.
public ITransportMessageContext Map<TMessage>(ITransportMessageContext source, string targetTransportName) where TMessage : class
Parameters
sourceITransportMessageContextThe source context.
targetTransportNamestringThe target transport name.
Returns
- ITransportMessageContext
The mapped context.
Type Parameters
TMessageThe message type.