Class MessageContext
- Namespace
- AnyProtocol
- Assembly
- AnyProtocol.dll
Carries the public message metadata for one pipeline invocation.
public sealed class MessageContext : IMessageContext
- Inheritance
-
MessageContext
- Implements
- Inherited Members
Constructors
MessageContext(IMessageHeaders, ReadOnlyMemory<byte>, string, MessageType, MessageDirection, CancellationToken)
Initializes a new instance of the MessageContext class.
public MessageContext(IMessageHeaders headers, ReadOnlyMemory<byte> body, string channel, MessageType messageType, MessageDirection direction, CancellationToken cancellationToken = default)
Parameters
headersIMessageHeadersThe headers.
bodyReadOnlyMemory<byte>The body.
channelstringThe logical message channel.
messageTypeMessageTypeThe runtime type to resolve.
directionMessageDirectionThe direction.
cancellationTokenCancellationTokenThe token used to cancel the operation.
Properties
Body
Gets or initializes the body.
public ReadOnlyMemory<byte> Body { get; set; }
Property Value
- ReadOnlyMemory<byte>
The body.
CancellationToken
Gets the effective cancellation token for the current pipeline stage.
public CancellationToken CancellationToken { get; }
Property Value
Channel
Gets or initializes the channel.
public string Channel { get; set; }
Property Value
- string
The channel.
Direction
Gets or initializes the direction.
public MessageDirection Direction { get; set; }
Property Value
- MessageDirection
The direction.
Headers
Gets the metadata headers associated with the message.
public IMessageHeaders Headers { get; }
Property Value
- IMessageHeaders
The headers.
Items
Gets the items.
public IDictionary<string, object?> Items { get; }
Property Value
- IDictionary<string, object>
The items.
Message
Gets or initializes the message.
public object? Message { get; set; }
Property Value
- object
The message.
MessageType
Gets or initializes the message type.
public MessageType MessageType { get; set; }
Property Value
- MessageType
The message type.
Method
Gets or initializes the method.
public ContractMethodDescriptor? Method { get; set; }
Property Value
- ContractMethodDescriptor
The method.