Class AwsSqsDeadLetterOptions
Configuration options for AWS SQS dead-letter queue (DLQ) settings.
public sealed class AwsSqsDeadLetterOptions
- Inheritance
-
AwsSqsDeadLetterOptions
- Inherited Members
- Extension Methods
Remarks
When a message fails processing after the maximum number of receive attempts, it is automatically moved to the configured dead-letter queue for later analysis or reprocessing.
The QueueArn must reference an existing SQS queue that has been configured as a dead-letter queue for the source queue.
Fields
DefaultMaxReceiveCount
The default value for MaxReceiveCount.
public const int DefaultMaxReceiveCount = 5
Field Value
MaxMaxReceiveCount
The maximum allowed value for MaxReceiveCount.
public const int MaxMaxReceiveCount = 1000
Field Value
MinMaxReceiveCount
The minimum allowed value for MaxReceiveCount.
public const int MinMaxReceiveCount = 1
Field Value
Properties
MaxReceiveCount
Gets or sets the maximum number of times a message is received before being sent to the dead-letter queue.
public int MaxReceiveCount { get; set; }
Property Value
- int
A value between 1 and 1000. Default is 5.
Remarks
When a consumer receives a message but does not delete it within the visibility timeout, the message becomes visible again and the receive count is incremented.
Once the receive count exceeds MaxReceiveCount, the message is moved to the dead-letter queue.
Exceptions
- ArgumentOutOfRangeException
Thrown when the value is less than 1 or greater than 1000.
QueueArn
Gets or sets the ARN of the dead-letter queue.
public string? QueueArn { get; set; }
Property Value
- string
The Amazon Resource Name (ARN) of the dead-letter queue. Must be in the format: arn:aws:sqs:{region}:{account-id}:{queue-name}
Remarks
The dead-letter queue must exist in the same AWS region as the source queue.
Exceptions
- ArgumentException
Thrown when the value is null, empty, or whitespace.