Table of Contents

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

messageType MessageType

The message type.

channel string

The logical channel.

contractName string

The optional contract name.

methodName string

The optional method name.

contentType string

The optional content type.

source IMessageHeaders

Optional headers to copy before applying protocol metadata.

correlationId string

The optional correlation identifier.

replyTo string

The 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

requestHeaders IMessageHeaders

The request headers.

messageType MessageType

The 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.