Consuming device data

When a device publishes telemetry and state events to Cloud IoT Core, those events are propagated to Cloud Pub/Sub topics associated with the device registry. In previous examples, we configured the weather-sensors device registry to push telemetry events to the weather-telemetry topic and device state events to the weather-device-state topic. As covered earlier in this chapter, Cloud Pub/Sub queues messages based on subscriptions. When a Pub/Sub topic has no subscriptions, any messages published to that topic will simply be dropped.

Because device events are pushed to Cloud Pub/Sub topics, any service that can consume Pub/Sub messages is capable of receiving device events. Google Cloud Functions are a good candidate ...

Get Building Google Cloud Platform Solutions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.