Skip to content

DeleteMessageBatch

Source: src/AWS/SQS/DeleteMessageBatch.ts

Runtime binding for sqs:DeleteMessageBatch.

Bind this operation to a Queue inside a function runtime to delete up to 10 received messages per call with per-entry success/failure results. The binding grants the host function sqs:DeleteMessage on the queue. Provide the DeleteMessageBatchHttp layer on the Function to implement the binding.

// init (provide SQS.DeleteMessageBatchHttp on the Function)
const deleteMessageBatch = yield* SQS.DeleteMessageBatch(queue);
// runtime: acknowledge messages received via ReceiveMessage
const result = yield* deleteMessageBatch({
Entries: messages.map((message, index) => ({
Id: `${index}`,
ReceiptHandle: message.ReceiptHandle!,
})),
});
// result.Successful / result.Failed