0
votes

I have created a rule in AWS IoT.

This rule is very simple: AWS IoT receive a message from MQTT device and storage it in a DynamoDB table.

The problem is that the system receive without problem the message but after that the rule does not sent it to DynamoDB.

This is my topic

Topic

This is my rule

rule1

rule2

This is what I can see in CloudWatch (not sure if this is about the same problem)

CloudWatch

what could be wrong?

Thanks!

2
The DynamoDB CloudWatch metric you included the screenshot for is entirely irrelevant to the issue you are having, and isn't actually an issue at all. Your first step to debug this issue is to enable AWS IoT service logging to CloudWatch Logs: docs.aws.amazon.com/iot/latest/developerguide/… Then send another message to the topic and check the logs to see what the error is. - Mark B

2 Answers

1
votes

The solution is to publish the message in JSON format from Mosquitto:

  mosquitto_pub --cafile rootCA.pem --cert certificate.pem.crt --key private.pem.key -h XXXXX.iot.eu-west-2.amazonaws.com -p 8883 -q 1 -d -t topic -m {\"message\":\"3\"}

where message have to be the name of the primary key

0
votes

When you use custom Topics, it has to be updated in your policy click 'edit policy document' and add your topic and topic filter under resources.