MessageContext Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the context for storing different Features required for the processing of message(s).
public ref class MessageContext sealed
public sealed class MessageContext
type MessageContext = class
Public NotInheritable Class MessageContext
- Inheritance
-
MessageContext
Remarks
Inspired from ASP.NET Core HttpContext.
Constructors
MessageContext(IFeatureCollection) |
Initializes a new instance of the MessageContext class. |
Properties
DestinationFeatures |
Gets the feature collection to register implementation for different types for sending message to IMessageDestination. |
DestinationPayload |
Gets the message payload to be sent to IMessageDestination. |
Features |
Gets the feature collection to register implementation for different types which will be helpful to process the message. |
MessageCancelledToken |
Gets or sets the cancellation token for the cancelling the message processing. |
SourceFeatures |
Gets the feature collection to register implementation for different types for the message obtained from the IMessageSource. |
SourcePayload |
Gets the message payload obtained from the IMessageSource. |
Methods
AddDestinationFeature<T>(T) |
Sets the feature for the IMessageDestination in the DestinationFeatures. |
AddFeature<T>(T) |
Sets the feature of the IMessageSource in the Features. |
AddSourceFeature<T>(T) |
Sets the feature of the IMessageSource in the SourceFeatures. |
GetUTF8SourcePayloadAsString() |
Gets the SourcePayload as UTF8 encoded String. |
MarkCompleteAsync(CancellationToken) |
Marks the message processing to be completed asynchronously. |
SetDestinationPayload(ReadOnlyMemory<Byte>) |
Sets the payload in the MessageContext for the IMessageDestination message. |
TryGetUTF8DestinationPayloadAsString(String) |
Try to get the DestinationPayload message registered with MessageContext as a String in the UTF8 encoding. |