예제 #1
0
        public bool Delete(DeleteMessageRequest request)
        {
            if (request == null)
            {
                return(false);
            }

            var response = SqsClient.DeleteMessage(request);

            return(response != null);
        }
예제 #2
0
        private bool DeleteRecordSQS(string QueueUrl, Message InMessage)
        {
            DeleteMessageRequest DeleteRequest = new DeleteMessageRequest
            {
                QueueUrl      = QueueUrl,
                ReceiptHandle = InMessage.ReceiptHandle
            };

            var DeleteResponse = SqsClient.DeleteMessage(DeleteRequest);

            return(DeleteResponse.HttpStatusCode == HttpStatusCode.OK);
        }
예제 #3
0
        private bool TryDeleteRecordSQS(Message InMessage)
        {
#if DEBUG
            // Debug doesn't empty the queue - it's just reads records
            return(true);
#else
            try
            {
                var DeleteRequest = new DeleteMessageRequest
                {
                    QueueUrl      = Config.Default.AWSSQSQueueUrl,
                    ReceiptHandle = InMessage.ReceiptHandle
                };

                var DeleteResponse = SqsClient.DeleteMessage(DeleteRequest);
                return(DeleteResponse.HttpStatusCode == HttpStatusCode.OK);
            }
            catch (Exception Ex)
            {
                CrashReporterProcessServicer.WriteException("TryDeleteRecordSQS: " + Ex.ToString());
            }
            return(false);
#endif
        }