use of org.thingsboard.server.extensions.sqs.action.fifo.SqsFifoQueueActionMsg in project thingsboard by thingsboard.
the class SqsMessageHandler method sendMessageToFifoQueue.
private void sendMessageToFifoQueue(PluginContext ctx, TenantId tenantId, RuleId ruleId, RuleToPluginMsg<?> msg) {
SqsFifoQueueActionPayload payload = ((SqsFifoQueueActionMsg) msg).getPayload();
SendMessageRequest sendMsgRequest = new SendMessageRequest().withQueueUrl(payload.getQueue()).withMessageBody(payload.getMsgBody()).withMessageGroupId(payload.getDeviceId());
sqs.sendMessage(sendMsgRequest);
if (payload.isSync()) {
ctx.reply(new ResponsePluginToRuleMsg(msg.getUid(), tenantId, ruleId, BasicStatusCodeResponse.onSuccess(payload.getMsgType(), payload.getRequestId())));
}
}
Aggregations