Interface IAwsSqsDeadLetterBuilder
Fluent builder interface for configuring AWS SQS dead-letter queue settings.
public interface IAwsSqsDeadLetterBuilder
- Extension Methods
Remarks
This interface follows the Microsoft-style fluent builder pattern.
All methods return this for method chaining.
Methods
MaxReceiveCount(int)
Sets the maximum number of receives before a message is sent to the dead-letter queue.
IAwsSqsDeadLetterBuilder MaxReceiveCount(int count)
Parameters
countintThe maximum receive count (1-1000). Default is 5.
Returns
- IAwsSqsDeadLetterBuilder
The builder for fluent chaining.
Examples
.DeadLetterQueue(dlq =>
{
dlq.MaxReceiveCount(3); // Move to DLQ after 3 failed attempts
})
Remarks
When a message is received but not deleted within the visibility timeout, the receive count is incremented. Once the count exceeds this value, the message is moved to the dead-letter queue.
Exceptions
- ArgumentOutOfRangeException
Thrown when
countis less than 1 or greater than 1000.
QueueArn(string)
Sets the ARN of the dead-letter queue.
IAwsSqsDeadLetterBuilder QueueArn(string arn)
Parameters
arnstringThe Amazon Resource Name (ARN) of the dead-letter queue.
Returns
- IAwsSqsDeadLetterBuilder
The builder for fluent chaining.
Examples
.DeadLetterQueue(dlq =>
{
dlq.QueueArn("arn:aws:sqs:us-east-1:123456789012:my-dlq");
})
Remarks
The dead-letter queue must exist in the same AWS region as the source queue.
Exceptions
- ArgumentException
Thrown when
arnis null, empty, or whitespace.