Table of Contents

Class CloudOutboxMessage

Namespace
Excalibur.Data.CloudNative
Assembly
Excalibur.Data.Abstractions.dll

Represents an outbox message in a cloud-native database.

public sealed record CloudOutboxMessage : IEquatable<CloudOutboxMessage>
Inheritance
CloudOutboxMessage
Implements
Inherited Members

Properties

AggregateId

Gets the aggregate ID associated with the message.

public string? AggregateId { get; init; }

Property Value

string

AggregateType

Gets the aggregate type associated with the message.

public string? AggregateType { get; init; }

Property Value

string

CausationId

Gets the causation ID linking to the causing message.

public string? CausationId { get; init; }

Property Value

string

CorrelationId

Gets the correlation ID for distributed tracing.

public string? CorrelationId { get; init; }

Property Value

string

CreatedAt

Gets when the message was created.

public required DateTimeOffset CreatedAt { get; init; }

Property Value

DateTimeOffset

Destination

Gets the delivery destination this message is routed to, preserving the routing target through the cloud-native outbox round-trip rather than dropping it on the stage-then-reload path.

public string? Destination { get; init; }

Property Value

string

ETag

Gets the ETag for optimistic concurrency.

public string? ETag { get; init; }

Property Value

string

Headers

Gets the message headers/metadata.

public IDictionary<string, string>? Headers { get; init; }

Property Value

IDictionary<string, string>

IsPublished

Gets a value indicating whether the message has been published.

public bool IsPublished { get; }

Property Value

bool

LastError

Gets the last error message if publishing failed.

public string? LastError { get; init; }

Property Value

string

LeasedAt

Gets the instant this message's current claim lease was stamped, or null if the message is unclaimed.

public DateTimeOffset? LeasedAt { get; init; }

Property Value

DateTimeOffset?

Remarks

The lease expires at this instant plus the store's configured lease timeout; the timeout is configuration rather than a per-message field, so that changing it takes effect on messages already staged. Only stores implementing ICloudNativeOutboxStoreClaim ever set this.

LeasedBy

Gets the identifier of the claimant currently holding this message, or null if the message is unclaimed.

public string? LeasedBy { get; init; }

Property Value

string

Remarks

A stale value is expected and harmless: once the lease expires the message is claimable regardless of who is named here, and the next claim overwrites it. Read this as "who took it last", not as a live ownership assertion.

Change-feed and listener projections do not carry this field, or LeasedAt, and that asymmetry is intentional. A feed handler is not a claimant, so the only decision a lease value could support for it is whether to publish — and the paragraph above says the value does not support that decision. Carrying it would make an unsound choice available without making it sound. A handler reading an unclaimed message before a poller claims it publishes either way, so the field cannot prevent the duplicate it appears to prevent. Every other member of this record is carried by every read path.

MessageId

Gets the unique message identifier.

public required string MessageId { get; init; }

Property Value

string

MessageType

Gets the message type (typically the event type name).

public required string MessageType { get; init; }

Property Value

string

PartitionKeyValue

Gets the partition key value for the message.

public required string PartitionKeyValue { get; init; }

Property Value

string

Payload

Gets the serialized message payload.

public required byte[] Payload { get; init; }

Property Value

byte[]

PublishedAt

Gets when the message was published, or null if not yet published.

public DateTimeOffset? PublishedAt { get; init; }

Property Value

DateTimeOffset?

RetryCount

Gets the number of publish retry attempts.

public int RetryCount { get; init; }

Property Value

int

TenantId

Gets the tenant identifier, preserving tenant isolation through the cloud-native outbox round-trip.

public string? TenantId { get; init; }

Property Value

string