Table of Contents

Struct MessageMetadata

Namespace
Excalibur.Dispatch.Delivery
Assembly
Excalibur.Dispatch.dll

Represents message metadata.

[StructLayout(LayoutKind.Auto)]
public readonly struct MessageMetadata : IEquatable<MessageMetadata>
Implements
Inherited Members
Extension Methods

Remarks

Initializes a new instance of the MessageMetadata struct.

Constructors

MessageMetadata(Guid, Guid, long, MessageFlags, byte, byte, ushort)

Represents message metadata.

public MessageMetadata(Guid messageId, Guid correlationId, long timestampTicks, MessageFlags flags, byte deliveryCount, byte priority, ushort version)

Parameters

messageId Guid
correlationId Guid
timestampTicks long
flags MessageFlags
deliveryCount byte
priority byte
version ushort

Remarks

Initializes a new instance of the MessageMetadata struct.

Properties

CorrelationId

Gets the correlation ID.

public Guid CorrelationId { get; }

Property Value

Guid

The current CorrelationId value.

Default

Gets the default metadata.

public static MessageMetadata Default { get; }

Property Value

MessageMetadata

The default metadata.

DeliveryCount

Gets the delivery count.

public byte DeliveryCount { get; }

Property Value

byte

The current DeliveryCount value.

Flags

Gets the flags.

public MessageFlags Flags { get; }

Property Value

MessageFlags

The current Flags value.

MessageId

Gets the message ID.

public Guid MessageId { get; }

Property Value

Guid

The current MessageId value.

Priority

Gets the priority.

public byte Priority { get; }

Property Value

byte

The current Priority value.

TimestampTicks

Gets the timestamp ticks.

public long TimestampTicks { get; }

Property Value

long

The current TimestampTicks value.

Version

Gets the version.

public ushort Version { get; }

Property Value

ushort

The current Version value.

Methods

Equals(MessageMetadata)

Determines whether the specified metadata is equal to the current metadata.

public bool Equals(MessageMetadata other)

Parameters

other MessageMetadata

Returns

bool

Equals(object?)

Determines whether the specified object is equal to the current metadata.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

FromContext(IMessageContext)

Creates MessageMetadata from a context dictionary.

public static MessageMetadata FromContext(IMessageContext context)

Parameters

context IMessageContext

Returns

MessageMetadata

FromRecordMetadata(MessageMetadata)

Creates a struct-based MessageMetadata from the record-based version.

public static MessageMetadata FromRecordMetadata(MessageMetadata recordMetadata)

Parameters

recordMetadata MessageMetadata

Returns

MessageMetadata

GetHashCode()

Returns the hash code for this metadata.

public override int GetHashCode()

Returns

int

HasFlag(MessageFlags)

Checks if the metadata has a specific flag set.

public bool HasFlag(MessageFlags flag)

Parameters

flag MessageFlags

Returns

bool

ToRecordMetadata()

Converts this struct-based metadata to the record-based MessageMetadata.

public MessageMetadata ToRecordMetadata()

Returns

MessageMetadata

Operators

operator ==(MessageMetadata, MessageMetadata)

Determines whether two metadata instances are equal.

public static bool operator ==(MessageMetadata left, MessageMetadata right)

Parameters

left MessageMetadata
right MessageMetadata

Returns

bool

operator !=(MessageMetadata, MessageMetadata)

Determines whether two metadata instances are not equal.

public static bool operator !=(MessageMetadata left, MessageMetadata right)

Parameters

left MessageMetadata
right MessageMetadata

Returns

bool