Hello. I am trying to implement Queue in my projec...
# help
s
Hello. I am trying to implement Queue in my project, I want configure max retries for the Queue in case of failure. I referred the docs but I can't see any option which allow us to do that. Please help. Cc. @Harish Venkatesan
l
@Swapnil Bandiwadekar, what version of SST are you on? I'm still pre-v1 migration so can't be sure my snippets are gonna work
Running pre-v1 you can set it up like so:
Copy code
const costProcessingDLQ = new Queue(this, 'costProcessingDLQSST', {
            sqsQueue: new sqs.Queue(this, 'costProcessingDLQ', {
                deliveryDelay: Duration.millis(0),
                retentionPeriod: Duration.days(7),
            })
        })

const costProcessingSQS = new Queue(this, 'costProcessingSQSSST',
            {
                sqsQueue: new sqs.Queue(this, 'costProcessingSQS', {
                    deliveryDelay: Duration.millis(0),
                    retentionPeriod: Duration.days(3),
                    visibilityTimeout: Duration.seconds(90),
                    receiveMessageWaitTime: Duration.seconds(20),
                    deadLetterQueue: {
                        maxReceiveCount: 2,
                        queue: costProcessingDLQ.sqsQueue
                    }
                }),
            });
You can't set max retry on a standalone SQS, this can be achieved only by setting up a DLQ for it
The 'failed' events would keep getting invoked by your consumer until Queue retention period is reached
s
@Lukasz K Thank you for your help.
f
Thanks @Lukasz K!
@Swapnil Bandiwadekar lemme know if u got this to work
s
@Frank Yes it is working.