Interface IMessageEnvelopeFactory
- Namespace
- AnyProtocol.Abstraction
- Assembly
- AnyProtocol.Abstraction.dll
Creates message metadata without owning payload serialization or transport identity.
public interface IMessageEnvelopeFactory
Methods
CreateMessageId()
Creates a message identifier for an outbound envelope.
string CreateMessageId()
Returns
- string
A non-empty message identifier.
CreateOutboundHeaders(MessageType, string, string?, string?, string?, IMessageHeaders?, string?, string?)
Creates outbound headers with the standard AnyProtocol metadata.
IMessageHeaders CreateOutboundHeaders(MessageType messageType, string channel, string? contractName = null, string? methodName = null, string? contentType = null, IMessageHeaders? source = null, string? correlationId = null, string? replyTo = null)
Parameters
messageTypeMessageTypeThe message type.
channelstringThe logical channel.
contractNamestringThe optional contract name.
methodNamestringThe optional method name.
contentTypestringThe optional content type.
sourceIMessageHeadersOptional headers to copy before applying protocol metadata.
correlationIdstringThe optional correlation identifier.
replyTostringThe optional reply channel.
Returns
- IMessageHeaders
The created headers.
CreateResponseHeaders(IMessageHeaders, MessageType)
Creates response, stream, or fault headers for an existing request.
IMessageHeaders CreateResponseHeaders(IMessageHeaders requestHeaders, MessageType messageType)
Parameters
requestHeadersIMessageHeadersThe request headers.
messageTypeMessageTypeThe response message type.
Returns
- IMessageHeaders
The created response headers.
GetUtcNow()
Gets the current UTC time used for protocol metadata and deadlines.
DateTimeOffset GetUtcNow()
Returns
- DateTimeOffset
The current UTC time.