According to the Amazon documentation, the code to delete a single message from the SQS Queue is:
// Delete a message
System.out.println("Deleting a message.\n");
String messageReceiptHandle = messages.get(0).getReceiptHandle();
sqs.deleteMessage(new DeleteMessageRequest()
.withQueueUrl(myQueueUrl)
.withReceiptHandle(messageReceiptHandle));
However, say I have more than 20 or so messages, do I really have to process this for every single message? Or is there a way to do a batch delete?
Thanks for any insights.