Connecting Google Pub Sub to a Waylay Broker
- Access to GCP (Google Cloud Platform)
- Service account of Pub/Sub
- IoT connected device
- Waylay Broker url
Main building blocks of this integration are presented below:
Say your organisation has some devices that are connected in Google Pub/Sub and that the devices are configured to push their telemetry data to a Topic or multiple Topics. How does one connect this data on these topic to a Waylay Environment for creating rules and templates? The service connector allows you to bridge the connection between Google PubSub and your Waylay environment fairly easy!
All one needs to do is to download this service connector as a Docker image and run it with a file that contains the environment variables.
The command for running the docker is as followed:
docker run -p 3000:3000 --rm --name connector --env-file=PathToFile/connectorFile googleIoTConnectorDockerImage
Create a file and insert the configurable variables listed below.
Configuration of Google PubSub Connector
The following environment variables have to be configured:
||Flattening JSON objects or not (value can be ‘flat’ or not filled in)|
||Google Application Credentials for Pub/Sub. Must be a JSON type key.|
||Google Project ID|
||Google PubSub Topics names (seperated by
||Google PubSub Subscription name|
||TenantId of your organisation|
||Secret of your application|
||Id of your application|
||Waylay accounts url|
||URL of your broker|
Make a google service account for Pub/Sub and specifiy a relative path to that JSON file.
Unique Google Project Id
Name of the PubSub Topic for where this service needs to pull messages from. This can be multiple Topics at once seperated by
Name of the PubSub subscription. Can be any name, the name of the subscription gets postfixes with an unique id.
PUBSUB_SUBSCRIPTION=test Will resolve in
This will convert nested JSON objects into flat (key, value) objects so that all metric are stored in the timeseries database.
PARSE_MODE='flat' or not specified