Table of Contents

Class KafkaToRabbitMqMapper

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

Message mapper for converting Kafka messages to RabbitMQ format.

public sealed class KafkaToRabbitMqMapper : DefaultMessageMapper, IMessageMapper
Inheritance
KafkaToRabbitMqMapper
Implements
Inherited Members
Extension Methods

Remarks

This mapper handles the property translation between Kafka and RabbitMQ transports. Properties stored in Kafka headers using the x- prefix convention are restored to their native RabbitMQ equivalents.

Property Mapping:

KafkaRabbitMQ
KeyRoutingKey (direct mapping)
Header x-priorityPriority (restored if present)
Header x-expirationExpiration (restored if present)
Header x-reply-toReplyTo (restored if present)
TopicNot mapped (different routing paradigm)
Partition/OffsetOmitted (Kafka-specific)

Constructors

KafkaToRabbitMqMapper()

Initializes a new instance of the KafkaToRabbitMqMapper class.

public KafkaToRabbitMqMapper()

Fields

ExpirationHeader

Header name for restoring RabbitMQ expiration from Kafka messages.

public const string ExpirationHeader = "x-expiration"

Field Value

string

PriorityHeader

Header name for restoring RabbitMQ priority from Kafka messages.

public const string PriorityHeader = "x-priority"

Field Value

string

ReplyToHeader

Header name for restoring RabbitMQ reply-to from Kafka messages.

public const string ReplyToHeader = "x-reply-to"

Field Value

string

Methods

CopyTransportProperties(ITransportMessageContext, TransportMessageContext)

Copies transport-specific properties from source to target context.

protected override void CopyTransportProperties(ITransportMessageContext source, TransportMessageContext target)

Parameters

source ITransportMessageContext

The source context.

target TransportMessageContext

The target context.

Remarks

Override this method to customize how transport properties are copied or transformed.