Ejemplo n.º 1
0
 public static void ValidateSendMessage(SendMessageRequest request, SendMessageResponse response)
 {
     if (request != null && response != null &&
         request.MessageBody != null && response.SendMessageResult != null &&
         !string.IsNullOrEmpty(request.MessageBody) &&
         !string.IsNullOrEmpty(response.SendMessageResult.MD5OfMessageBody))
     {
         AmazonSQSUtil.ValidateMD5(request.MessageBody, response.SendMessageResult.MD5OfMessageBody);
     }
 }
Ejemplo n.º 2
0
 public static void ValidateReceiveMessage(ReceiveMessageResponse response)
 {
     if (response != null && response.ReceiveMessageResult != null &&
         response.ReceiveMessageResult.Message != null && response.ReceiveMessageResult.Message.Count > 0)
     {
         foreach (Message message in response.ReceiveMessageResult.Message)
         {
             AmazonSQSUtil.ValidateMD5(message);
         }
     }
 }
Ejemplo n.º 3
0
        public static void ValidateSendMessageBatch(SendMessageBatchRequest request, SendMessageBatchResponse response)
        {
            if (response != null && response.SendMessageBatchResult != null &&
                response.SendMessageBatchResult.SendMessageBatchResultEntry != null && response.SendMessageBatchResult.SendMessageBatchResultEntry.Count > 0)
            {
                Dictionary <string, string> requestMessages = request.Entries.ToDictionary(entry => entry.Id, entry => entry.MessageBody, StringComparer.Ordinal);

                List <SendMessageBatchResultEntry> resultEntries = response.SendMessageBatchResult.SendMessageBatchResultEntry;
                foreach (SendMessageBatchResultEntry entry in resultEntries)
                {
                    string body = requestMessages[entry.Id];
                    string md5  = entry.MD5OfMessageBody;
                    string id   = entry.MessageId;

                    AmazonSQSUtil.ValidateMD5(body, id, md5);
                }
            }
        }