Search code examples
google-cloud-platformgoogle-cloud-functionsgoogle-cloud-pubsubgoogle-cloud-iot

How can i use the Google Cloud IoT data direct in the server based app?


I am new to Google Clout Iot core. I just tried the iot core, registered the device and published some data on a topic.

Now i am wondering is only Google functions are used to get/subscribe data from it? or can i also used the data published from a device directly into my applications e.g. node.js or python? like it is usually subscribed through a normal MQTT topic? I dont need a serverless architecture i want to use the data from google iot into my server and store/use it from there..

thanks a lot!


Solution

  • When a message arrives over MQTT or HTTP from a device over IoT Core, that message is published on a GCP Pub/Sub topic using the GCP Pub/Sub infrastructure. What this means is that you can develop a consuming application however you like as long as that application consumes the message from Pub/Sub.

    The diagram shown here from the documentation is a good reference.

    GCP exposes the API for Pub/Sub to be a subscriber. There are language bindings for a variety of languages.

    Cloud Functions is typically seen as a serverless consumer of Pub/Sub messages as it scales to zero and can scale up if there is bursty load. However, there is nothing to prevent you from writing Compute Engine hosted applications or Container hosted applications which can act as subscribers.

    References: