Seth Geoghegan
10/19/2021, 3:55 PMSeth Geoghegan
10/19/2021, 3:55 PMSeth Geoghegan
10/19/2021, 3:56 PMSeth Geoghegan
10/19/2021, 3:57 PMthdxr
10/19/2021, 4:03 PMthdxr
10/19/2021, 4:04 PMSeth Geoghegan
10/19/2021, 4:05 PMSeth Geoghegan
10/19/2021, 4:05 PMthdxr
10/19/2021, 4:06 PMSeth Geoghegan
10/19/2021, 4:06 PMthdxr
10/19/2021, 4:06 PMconsumer: {
function: {
handler: "services/catalog/price.update",
timeout: Duration.minutes(2),
reservedConcurrentExecutions: 10,
},
},
Seth Geoghegan
10/19/2021, 4:07 PMSeth Geoghegan
10/19/2021, 4:14 PMSeth Geoghegan
10/19/2021, 4:17 PM// Create the source DLQ in native CDK
const sourceDLQ = new sqs.Queue(this, `kas-source-dlq-${this.stage}`);
// Create the source queue in native CDK
const sourceQueue = new sqs.Queue(this, `kas-source-queue-main-${this.stage}`, {
deadLetterQueue: {
maxReceiveCount: 3,
queue: sourceDLQ
}
});
// Pass the source queue into sst.Queue and add a consumer
new sst.Queue(this, `kas-source-queue-${this.stage}`, {
consumer: {
srcPath: "functions",
handler: "record_source/create.handler",
reservedConcurrentExecutions: 30
},
consumerProps: {
batchSize: 10,
},
sqsQueue: sourceQueue,
});
Seth Geoghegan
10/19/2021, 4:18 PMconsumer
settings into a standalone Function
construct and pass that to the sst.Queue
and the sst.Api