Table of Contents

Class OutboxMessage<TPayload>

Namespace
PatternKit.Messaging.Reliability
Assembly
PatternKit.Core.dll

In-process outbox record that can be persisted by application code before dispatch.

public sealed class OutboxMessage<TPayload>

Type Parameters

TPayload

The payload type stored in the outbox record.

Inheritance
OutboxMessage<TPayload>
Inherited Members

Constructors

OutboxMessage(string, Message<TPayload>, DateTimeOffset)

Creates an outbox record.

public OutboxMessage(string id, Message<TPayload> message, DateTimeOffset createdAt)

Parameters

id string
message Message<TPayload>
createdAt DateTimeOffset

Properties

Attempts

The number of dispatch attempts.

public int Attempts { get; }

Property Value

int

CreatedAt

When the outbox record was created.

public DateTimeOffset CreatedAt { get; }

Property Value

DateTimeOffset

Dispatched

Gets whether the outbox record has been dispatched.

public bool Dispatched { get; }

Property Value

bool

DispatchedAt

When the outbox record was dispatched, if it has been dispatched.

public DateTimeOffset? DispatchedAt { get; }

Property Value

DateTimeOffset?

Id

The outbox record identifier.

public string Id { get; }

Property Value

string

LastError

The last dispatch error, when available.

public string? LastError { get; }

Property Value

string

Message

The message to dispatch.

public Message<TPayload> Message { get; }

Property Value

Message<TPayload>

Methods

MarkDispatched(DateTimeOffset)

Returns a copy marked as dispatched.

public OutboxMessage<TPayload> MarkDispatched(DateTimeOffset dispatchedAt)

Parameters

dispatchedAt DateTimeOffset

Returns

OutboxMessage<TPayload>

WithAttempt(string?)

Returns a copy with dispatch attempt metadata recorded.

public OutboxMessage<TPayload> WithAttempt(string? error)

Parameters

error string

Returns

OutboxMessage<TPayload>