static void CheckDeleteMessageResponse(Amazon.SQS.Model.DeleteMessageResponse delMsgRsp) { if (delMsgRsp == null) { throw new Exception("Failed to Delete Message"); } }
/// <summary> /// Deletes a message from an SQS queue. /// </summary> /// <param name="queueUrl">The sqs queue endpoint to delete the message from.</param> /// <param name="receiptHandle">The unique receipt handle for the message.</param> public static Amazon.SQS.Model.DeleteMessageResponse Delete(string queueUrl, string receiptHandle) { Amazon.SQS.Model.DeleteMessageResponse response = new Amazon.SQS.Model.DeleteMessageResponse(); using (Amazon.SQS.IAmazonSQS client = new Factory().SQSClient()) { Amazon.SQS.Model.DeleteMessageRequest request = new Amazon.SQS.Model.DeleteMessageRequest() { QueueUrl = queueUrl, ReceiptHandle = receiptHandle }; response = client.DeleteMessage(request); } return response; }