Table of Contents

Class DynamoDbOutboxStreamsSubscription

Namespace
Excalibur.Outbox.DynamoDb
Assembly
Excalibur.Outbox.DynamoDb.dll

DynamoDB Streams subscription specialized for outbox messages. Only emits unpublished messages (new inserts that are not yet published).

[SuppressMessage("Maintainability", "CA1506:Avoid excessive class coupling", Justification = "Change feed implementations inherently couple with many SDK and abstraction types.")]
public sealed class DynamoDbOutboxStreamsSubscription : IChangeFeedSubscription<CloudOutboxMessage>, IAsyncDisposable
Inheritance
DynamoDbOutboxStreamsSubscription
Implements
Inherited Members

Remarks

This subscription filters stream events to only emit unpublished outbox messages, making it suitable for push-based outbox processing. Published messages and updates are filtered out.

Constructors

DynamoDbOutboxStreamsSubscription(IAmazonDynamoDB, IAmazonDynamoDBStreams, DynamoDbOutboxOptions, IChangeFeedOptions, ILogger)

Initializes a new instance of the DynamoDbOutboxStreamsSubscription class.

public DynamoDbOutboxStreamsSubscription(IAmazonDynamoDB client, IAmazonDynamoDBStreams streamsClient, DynamoDbOutboxOptions storeOptions, IChangeFeedOptions options, ILogger logger)

Parameters

client IAmazonDynamoDB

The DynamoDB client.

streamsClient IAmazonDynamoDBStreams

The DynamoDB Streams client.

storeOptions DynamoDbOutboxOptions

The outbox store options. The table name and the key attribute names are read from here, so a table whose key attributes are named anything other than the defaults is read back correctly.

options IChangeFeedOptions

The change feed options.

logger ILogger

The logger.

Properties

CurrentContinuationToken

public string? CurrentContinuationToken { get; }

Property Value

string

IsActive

Gets a value indicating whether the subscription is active.

public bool IsActive { get; }

Property Value

bool

SubscriptionId

Gets the subscription identifier.

public string SubscriptionId { get; }

Property Value

string

Methods

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

ReadChangesAsync(CancellationToken)

Gets the async enumerable of change events.

public IAsyncEnumerable<IChangeFeedEvent<CloudOutboxMessage>> ReadChangesAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

IAsyncEnumerable<IChangeFeedEvent<CloudOutboxMessage>>

An async enumerable of change feed events.

StartAsync(CancellationToken)

Starts the subscription and begins receiving changes.

public Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

A task representing the subscription startup.

StopAsync(CancellationToken)

Stops the subscription gracefully.

public Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

A task representing the graceful shutdown.