0
votes

I am testing AWS IoT rule to republish for the IoT topic with an AWS IOT rule actions. My mqtt clients are publishing in different topics: device A publish data into topicA, device B publish data into topicsB.

So in AWS IoT console, I defined a SQL rule selecting all devices coming from the topic as '#'. In this case, I'm not able to invoke rule if one of mttq client is publishing for the topic 'topicA' or 'topicB'.

I have written my rule by following these steps:

1.My query string is

SELECT * FROM '#'

2.My action is Republish messages to an AWS IoT topic. This action will republish the message to another AWS IoT topic given below:

topicsC

What is the right way to invoke a rule which is in my case if someone published for any topic?

1

1 Answers

0
votes

You can't create a republish rule where the input topic filter includes the output topic. e.g. if you can't have SELECT * FROM # and publish to a topic called topicsC because topicsC is included in #. If you could the rule would invoke itself.

You should add a / to create a namespace in your topics.

You could have devices A and B publish to device/A and device/B respectively. Then you can have a republish rule SELECT * FROM 'device/# which republishes to a different topic, alldata.