Jason
03/30/2022, 1:13 PMreportBatchItemFailures
set to true, and my return from the lambda is
{
batchItemFailures: [ { itemIdentifier: 'd6d84d1b-a232-46f8-822d-bc4b232c5a45' } ]
}
So I would expect it to be retried after the visibility timeout, not deleted. But it's not being retried, and when I check the monitoring tab it shows that the message was deleted.
Queue definition:
new sst.Queue(this, 'name', {
sqsQueue: {
retentionPeriod: Duration.days(14),
visibilityTimeout: Duration.seconds(30),
deadLetterQueue: {
queue: deadLetterQueue.sqsQueue,
maxReceiveCount: 8,
},
},
consumer: {
deadLetterQueueEnabled: true,
handler: 'src/services/svc.handler',
timeout: 5,
memorySize: 8192,
consumerProps: { reportBatchItemFailures: true, batchSize: 5 },
},
});
Handler:
export const handler = async (event: SQSEvent) => {
const failedIds = await run(event);
const response = {
batchItemFailures: failedIds.map((id) => {
return {
itemIdentifier: id,
};
}),
};
console.log('Response: ', response);
return response;
};
Anything I could be missing?Jason
03/31/2022, 9:52 AMhandler
property, it works. I would've never noticed this but another one of our consumers happened to be defined in that way and was working as expected. When using {consumer: {handler: "handlerpath"}
the cloudformation template does not populate the functionResponseType in the event source mapping