Struct MessageMetadata
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
messageIdGuidcorrelationIdGuidtimestampTickslongflagsMessageFlagsdeliveryCountbyteprioritybyteversionushort
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
Priority
Gets the priority.
public byte Priority { get; }
Property 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
Methods
Equals(MessageMetadata)
Determines whether the specified metadata is equal to the current metadata.
public bool Equals(MessageMetadata other)
Parameters
otherMessageMetadata
Returns
Equals(object?)
Determines whether the specified object is equal to the current metadata.
public override bool Equals(object? obj)
Parameters
objobject
Returns
FromContext(IMessageContext)
Creates MessageMetadata from a context dictionary.
public static MessageMetadata FromContext(IMessageContext context)
Parameters
contextIMessageContext
Returns
FromRecordMetadata(MessageMetadata)
Creates a struct-based MessageMetadata from the record-based version.
public static MessageMetadata FromRecordMetadata(MessageMetadata recordMetadata)
Parameters
recordMetadataMessageMetadata
Returns
GetHashCode()
Returns the hash code for this metadata.
public override int GetHashCode()
Returns
HasFlag(MessageFlags)
Checks if the metadata has a specific flag set.
public bool HasFlag(MessageFlags flag)
Parameters
flagMessageFlags
Returns
ToRecordMetadata()
Converts this struct-based metadata to the record-based MessageMetadata.
public MessageMetadata ToRecordMetadata()
Returns
Operators
operator ==(MessageMetadata, MessageMetadata)
Determines whether two metadata instances are equal.
public static bool operator ==(MessageMetadata left, MessageMetadata right)
Parameters
leftMessageMetadatarightMessageMetadata
Returns
operator !=(MessageMetadata, MessageMetadata)
Determines whether two metadata instances are not equal.
public static bool operator !=(MessageMetadata left, MessageMetadata right)
Parameters
leftMessageMetadatarightMessageMetadata