code: private static void sendMessageOperationMd5Check(SendMessageRequest sendMessageRequest,
                                                       SendMessageResult sendMessageResult) {
          String messageBodySent = sendMessageRequest.getMessageBody();
          String bodyMd5Returned = sendMessageResult.getMD5OfMessageBody();
          String clientSideBodyMd5 = calculateMessageBodyMd5(messageBodySent);
          if (!clientSideBodyMd5.equals(bodyMd5Returned)) {
              throw new AmazonClientException(String.format(MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_BODY, clientSideBodyMd5,
                      bodyMd5Returned));
          }
  
          Map<String, MessageAttributeValue> messageAttrSent = sendMessageRequest.getMessageAttributes();
          if (messageAttrSent != null && !messageAttrSent.isEmpty()) {
              String clientSideAttrMd5 = calculateMessageAttributesMd5(messageAttrSent);
              String attrMd5Returned = sendMessageResult.getMD5OfMessageAttributes();
              if (!clientSideAttrMd5.equals(attrMd5Returned)) {
                  throw new AmazonClientException(String.format(MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_ATTRIBUTES,
                          clientSideAttrMd5, attrMd5Returned));
              }
          }
      }
docs: Throw an exception if the MD5 checksums returned in the SendMessageResult do not match the
  client-side calculation based on the original message in the SendMessageRequest.