Table of Contents

Class RabbitMqMessageContext

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

RabbitMQ-specific message context providing access to RabbitMQ routing and delivery properties.

public sealed class RabbitMqMessageContext : TransportMessageContext, ITransportMessageContext
Inheritance
RabbitMqMessageContext
Implements
Inherited Members
Extension Methods

Remarks

This context extends TransportMessageContext with RabbitMQ-specific properties such as exchange, routing key, delivery tag, and priority. These properties are stored as transport properties and can be accessed through strongly-typed properties or via GetTransportProperty<T>(string).

Constructors

RabbitMqMessageContext()

Initializes a new instance of the RabbitMqMessageContext class with a generated message ID.

public RabbitMqMessageContext()

RabbitMqMessageContext(string)

Initializes a new instance of the RabbitMqMessageContext class.

public RabbitMqMessageContext(string messageId)

Parameters

messageId string

The unique message identifier.

Fields

DeliveryModePropertyName

The transport property name for the delivery mode (persistent/non-persistent).

public const string DeliveryModePropertyName = "DeliveryMode"

Field Value

string

DeliveryTagPropertyName

The transport property name for the delivery tag.

public const string DeliveryTagPropertyName = "DeliveryTag"

Field Value

string

ExchangePropertyName

The transport property name for the exchange.

public const string ExchangePropertyName = "Exchange"

Field Value

string

ExpirationPropertyName

The transport property name for message expiration.

public const string ExpirationPropertyName = "Expiration"

Field Value

string

PriorityPropertyName

The transport property name for the priority.

public const string PriorityPropertyName = "Priority"

Field Value

string

RedeliveredPropertyName

The transport property name for whether the message was redelivered.

public const string RedeliveredPropertyName = "Redelivered"

Field Value

string

ReplyToPropertyName

The transport property name for the reply-to address.

public const string ReplyToPropertyName = "ReplyTo"

Field Value

string

RoutingKeyPropertyName

The transport property name for the routing key.

public const string RoutingKeyPropertyName = "RoutingKey"

Field Value

string

Properties

DeliveryMode

Gets or sets the delivery mode.

public byte DeliveryMode { get; set; }

Property Value

byte

1 for non-persistent, 2 for persistent delivery.

DeliveryTag

Gets or sets the delivery tag assigned by RabbitMQ.

public ulong DeliveryTag { get; set; }

Property Value

ulong

The delivery tag uniquely identifying this delivery on the channel. Used for acknowledgment.

Exchange

Gets or sets the exchange name for message routing.

public string? Exchange { get; set; }

Property Value

string

The RabbitMQ exchange name, or null for the default exchange.

Expiration

Gets or sets the message expiration time.

public string? Expiration { get; set; }

Property Value

string

The expiration time as a string (milliseconds), or null if the message doesn't expire.

Priority

Gets or sets the message priority.

public byte? Priority { get; set; }

Property Value

byte?

The message priority (0-255), or null if not set.

Redelivered

Gets or sets a value indicating whether this message was redelivered.

public bool Redelivered { get; set; }

Property Value

bool

true if this is a redelivery; otherwise, false.

ReplyTo

Gets or sets the reply-to address for request-reply patterns.

public string? ReplyTo { get; set; }

Property Value

string

The queue name to send replies to.

RoutingKey

Gets or sets the routing key for message routing.

public string? RoutingKey { get; set; }

Property Value

string

The routing key used to route the message to queues.