Table of Contents

Interface IMessageMapper<TSource, TTarget>

Namespace
Excalibur.Dispatch.Transport
Assembly
Excalibur.Dispatch.Abstractions.dll

Defines a typed mapper that transforms messages between specific source and target types.

public interface IMessageMapper<in TSource, out TTarget>

Type Parameters

TSource

The source message type.

TTarget

The target message type.

Extension Methods

Remarks

Use this interface when you need to transform the message payload itself, not just the transport context. This is useful for:

  • Converting between internal and external message formats
  • Version upgrades/downgrades for message schemas
  • Enriching messages with additional data

Methods

Map(TSource, ITransportMessageContext)

Maps a source message to a target message type.

TTarget Map(TSource source, ITransportMessageContext context)

Parameters

source TSource

The source message to transform.

context ITransportMessageContext

The transport context for the mapping operation.

Returns

TTarget

The transformed target message.

Exceptions

ArgumentNullException

Thrown when source is null.