Class RabbitMqMessageContext
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
messageIdstringThe unique message identifier.
Fields
DeliveryModePropertyName
The transport property name for the delivery mode (persistent/non-persistent).
public const string DeliveryModePropertyName = "DeliveryMode"
Field Value
DeliveryTagPropertyName
The transport property name for the delivery tag.
public const string DeliveryTagPropertyName = "DeliveryTag"
Field Value
ExchangePropertyName
The transport property name for the exchange.
public const string ExchangePropertyName = "Exchange"
Field Value
ExpirationPropertyName
The transport property name for message expiration.
public const string ExpirationPropertyName = "Expiration"
Field Value
PriorityPropertyName
The transport property name for the priority.
public const string PriorityPropertyName = "Priority"
Field Value
RedeliveredPropertyName
The transport property name for whether the message was redelivered.
public const string RedeliveredPropertyName = "Redelivered"
Field Value
ReplyToPropertyName
The transport property name for the reply-to address.
public const string ReplyToPropertyName = "ReplyTo"
Field Value
RoutingKeyPropertyName
The transport property name for the routing key.
public const string RoutingKeyPropertyName = "RoutingKey"
Field Value
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
Expiration
Gets or sets the message expiration time.
public string? Expiration { get; set; }
Property Value
Priority
Gets or sets the message priority.
public byte? Priority { get; set; }
Property Value
Redelivered
Gets or sets a value indicating whether this message was redelivered.
public bool Redelivered { get; set; }
Property Value
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.