Table of Contents

Class MessageMetadata

Namespace
Excalibur.Dispatch.Messaging
Assembly
Excalibur.Dispatch.dll

Default implementation of message metadata containing essential message properties.

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.PublicProperties)]
public record MessageMetadata : ITransportMessageMetadata, IEquatable<MessageMetadata>
Inheritance
MessageMetadata
Implements
Inherited Members
Extension Methods

Remarks

This record contains metadata that travels with messages through the dispatch pipeline, including correlation information, versioning, and tenant/user context.

Constructors

MessageMetadata(string, string, string?, string?, string?, string?, string, string, string, string)

Default implementation of message metadata containing essential message properties.

public MessageMetadata(string MessageId, string CorrelationId, string? CausationId, string? TraceParent, string? TenantId, string? UserId, string ContentType, string SerializerVersion, string MessageVersion, string ContractVersion = "1.0.0")

Parameters

MessageId string

Unique identifier for the message.

CorrelationId string

Unique identifier for tracking related messages.

CausationId string

Identifier of the message that caused this message.

TraceParent string

W3C trace context for distributed tracing.

TenantId string

Tenant identifier for multi-tenant scenarios.

UserId string

User identifier associated with the message.

ContentType string

MIME type of the message content.

SerializerVersion string

Version of the serializer used.

MessageVersion string

Version of the message format.

ContractVersion string

Version of the message contract (defaults to "1.0.0").

Remarks

This record contains metadata that travels with messages through the dispatch pipeline, including correlation information, versioning, and tenant/user context.

Properties

CausationId

Identifier of the message that caused this message.

public string? CausationId { get; init; }

Property Value

string

ContentType

MIME type of the message content.

public string ContentType { get; init; }

Property Value

string

ContractVersion

Version of the message contract (defaults to "1.0.0").

public string ContractVersion { get; init; }

Property Value

string

CorrelationId

Unique identifier for tracking related messages.

public string CorrelationId { get; init; }

Property Value

string

MessageId

Unique identifier for the message.

public string MessageId { get; init; }

Property Value

string

MessageVersion

Version of the message format.

public string MessageVersion { get; init; }

Property Value

string

SerializerVersion

Version of the serializer used.

public string SerializerVersion { get; init; }

Property Value

string

TenantId

Tenant identifier for multi-tenant scenarios.

public string? TenantId { get; init; }

Property Value

string

TraceParent

W3C trace context for distributed tracing.

public string? TraceParent { get; init; }

Property Value

string

UserId

User identifier associated with the message.

public string? UserId { get; init; }

Property Value

string

Methods

FromContext(IMessageContext)

Creates a MessageMetadata instance from a message context.

public static MessageMetadata FromContext(IMessageContext context)

Parameters

context IMessageContext

The message context.

Returns

MessageMetadata

A new MessageMetadata instance.