Table of Contents

Interface IPreparedTransactionalOutboxWrite

Namespace
Excalibur.Dispatch
Assembly
Excalibur.Dispatch.Abstractions.dll

Owns an immutable provider-encoded outbox write prepared before a transaction begins.

public interface IPreparedTransactionalOutboxWrite
Extension Methods

Remarks

Preparation, including configured payload transforms and metadata encoding, has already completed. Implementations must preserve the same row identity and exact encoded values across staging retries. This handle is process-local; persist its canonical data, never this object or a delegate.

Properties

MessageId

Gets the owning provider's immutable outbox row identifier.

string MessageId { get; }

Property Value

string

TenantId

Gets the immutable message tenant provenance, independent of later ambient context.

string? TenantId { get; }

Property Value

string

Methods

GetCanonicalWireBytes()

Returns a caller-owned copy of the complete, versioned canonical persisted wire representation.

byte[] GetCanonicalWireBytes()

Returns

byte[]

A fresh byte array covering the exact payload, encoded headers/metadata, routing and transport values, and the provider/table ownership binding.

Remarks

The representation must be unambiguous and stable. Mutating the returned array cannot affect this handle. Staging consumes precisely the encoded values represented here, without reserializing caller objects.

StageAsync(IDbTransaction, CancellationToken)

Inserts this already-prepared write on the supplied transaction without committing or rolling it back.

ValueTask StageAsync(IDbTransaction transaction, CancellationToken cancellationToken)

Parameters

transaction IDbTransaction

The exclusive transaction owned by the coordinating store.

cancellationToken CancellationToken

The operation cancellation token.

Returns

ValueTask

The asynchronous staging operation.

Remarks

Implementations validate their supported concrete transaction and use its exact connection. They do not open a second connection, run a payload transform, regenerate identity, re-encode metadata or commit. A successful insert is provisional until the transaction owner commits. Duplicate identity is not automatically idempotent acceptance; the owner must first resolve its authoritative transition receipt.