I am trying to listen to the MQTT commands topic. I am publishing messages to the MQTT commands topic through the IoT Core function sendCommandToDevice. Is there a way to use a cloud function to listen to the commands MQTT topic?
- set up a Pub/Sub topic to which all commands are sent and then trigger a function which relays them to the appropriate device via MQTT.
- have two listeners/functions (one to relay the command and the other to do whatever else you like).
- use a simulator to send messages that executes a cloud function which in turn sends the message to Cloud pub/sub topic. There can be a separate Cloud pub/sub topic for the response back from the bridge devices.