Class DynamoDbStalePositionDetector
Detects and classifies stale CDC position errors from DynamoDB Streams exceptions.
public static class DynamoDbStalePositionDetector
- Inheritance
-
DynamoDbStalePositionDetector
- Inherited Members
Remarks
DynamoDB Streams reports stale position scenarios through specific exception types:
- ExpiredIteratorException - Iterator expired (15-minute timeout)
- TrimmedDataAccessException - Data beyond 24-hour trim horizon
- ResourceNotFoundException - Stream/shard not found
Properties
StalePositionExceptionTypes
Gets the set of AWS exception type names that indicate a stale CDC position.
public static IReadOnlySet<string> StalePositionExceptionTypes { get; }
Property Value
Methods
CreateEventArgs(Exception, string, DynamoDbCdcPosition?, DynamoDbCdcPosition?, string?, string?, string?, string?)
Creates a CdcPositionResetEventArgs from an exception and context.
public static CdcPositionResetEventArgs CreateEventArgs(Exception exception, string processorId, DynamoDbCdcPosition? stalePosition = null, DynamoDbCdcPosition? newPosition = null, string? streamArn = null, string? tableName = null, string? shardId = null, string? sequenceNumber = null)
Parameters
exceptionExceptionThe exception that was caught.
processorIdstringThe identifier of the CDC processor.
stalePositionDynamoDbCdcPositionThe sequence number position that was detected as stale.
newPositionDynamoDbCdcPositionThe new position to resume from, if known.
streamArnstringThe Stream ARN, if known.
tableNamestringThe table name, if known.
shardIdstringThe affected shard ID, if known.
sequenceNumberstringThe stale sequence number, if known.
Returns
- CdcPositionResetEventArgs
A populated CdcPositionResetEventArgs instance.
GetReasonCode(Exception?)
Determines the appropriate reason code from a DynamoDB exception.
public static string GetReasonCode(Exception? exception)
Parameters
exceptionExceptionThe DynamoDB exception to analyze.
Returns
- string
The reason code string.
GetStalePositionExceptionType(Exception?)
Extracts the AWS exception type name that indicates a stale position from the exception.
public static string? GetStalePositionExceptionType(Exception? exception)
Parameters
exceptionExceptionThe exception to analyze.
Returns
IsStalePositionException(Exception?)
Determines whether the specified exception indicates a stale CDC position.
public static bool IsStalePositionException(Exception? exception)
Parameters
exceptionExceptionThe exception to analyze.