Example usage for com.amazonaws.services.sqs.model SendMessageResult getMD5OfMessageAttributes

List of usage examples for com.amazonaws.services.sqs.model SendMessageResult getMD5OfMessageAttributes

Introduction

In this page you can find the example usage for com.amazonaws.services.sqs.model SendMessageResult getMD5OfMessageAttributes.

Prototype


public String getMD5OfMessageAttributes() 

Source Link

Document

An MD5 digest of the non-URL-encoded message attribute string.

Usage

From source file:org.thingsboard.rule.engine.aws.sqs.TbSqsNode.java

License:Apache License

private TbMsg processSendMessageResult(TbContext ctx, TbMsg origMsg, SendMessageResult result) {
    TbMsgMetaData metaData = origMsg.getMetaData().copy();
    metaData.putValue(MESSAGE_ID, result.getMessageId());
    metaData.putValue(REQUEST_ID, result.getSdkResponseMetadata().getRequestId());
    if (!StringUtils.isEmpty(result.getMD5OfMessageBody())) {
        metaData.putValue(MESSAGE_BODY_MD5, result.getMD5OfMessageBody());
    }// w  w  w .j ava 2 s . c  o  m
    if (!StringUtils.isEmpty(result.getMD5OfMessageAttributes())) {
        metaData.putValue(MESSAGE_ATTRIBUTES_MD5, result.getMD5OfMessageAttributes());
    }
    if (!StringUtils.isEmpty(result.getSequenceNumber())) {
        metaData.putValue(SEQUENCE_NUMBER, result.getSequenceNumber());
    }
    return ctx.transformMsg(origMsg, origMsg.getType(), origMsg.getOriginator(), metaData, origMsg.getData());
}