简体   繁体   中英

Google Cloud IoT- How to publish to the same topic with multiple IoT devices and process it by cloud functions

In my project multiple IoT devices need to publish to a single topic and cloud functions listening to that topic need to process data published by IoT devices. Multiple devices should be able to publish at the same time.A MQTT broker logic is needed. But in Google IoT Core "The MQTT bridge allows only a single connection for a given device ID. If a second device connects with the ID of a device that is already connected, the older device connection will be closed automatically." .

I am new to google cloud IoT and trying to understand basic concepts. I have looked into gateways but I am not sure that gateways work as broker. Can multiple devices publish through a gateway to a same single topic? or should I implement/add a MQTT broker(mosquitto I guess) myself or is there an another way to use google Cloud IoT in my case? Could you guys direct me to the right direction. Opening sub/pub topics for each device doesn't sound right because in my project there can be thousands of IoT devices.

Let all the devices in the registry publish messages to the common topic given to the registry.Then trigger a cloud function with this topic. You can process the messages with cloud function based on the deviceId

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM