I have configured a lambda to a IOT Rule. The MQTT topic will get binary data and on arrival of data the rule should invoke lambda.
The lambda gets invoked when I post normal JSON data, but if I post any binary data, the lambda does not get invoked.
But at the same time, I am able to consume the binary data posted to MQTT through my stand alone consumer and able to deserialise it successfully.
So what is that I am missing here ?
When the message payload should be handled as raw binary data (rather than a JSON object), you can use the * operator to refer to it in a SELECT clause.
Do this on your rule:
SELECT encode(*, 'base64') AS data, timestamp() AS ts FROM 'a/b'
This way it will get invoked.
https://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-select.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With