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