This page contains detailed information about the Google Cloud Platform Pub/Sub service in the Tartabit IoT Bridge. This service lets you integrate LPWAN devices to applications by interacting with topics by publishing or subscribing for data.
The GCP Pub/Sub service contains information required to establish a service connection to GCP.
{
"type": "service_account",
"project_id": "tartabit-demo",
"private_key_id": "0f5b95*****036cf23",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIE*****demo.iam.gserviceaccount.com",
"client_id": "116*****70497",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-hhp39%40tartabit-demo.iam.gserviceaccount.com"
}
projects/tartabit-engr/subscriptions/demo1-sub
enter only demo1-sub
.This event fires when a message is received on one of the subscriptions being listened to.
{
"data": {
"a": "abc",
"b": 123
},
"attributes": {
"cluster":"production"
},
"id": "7092469952611319",
"subscription": "demo1-sub"
}
Send messages to a topic.
// Send message to the specified topic.
gcp_pubsub.publish('myservice', 'demo1', {"field1": "abc", "field2": 456})
// Send message to the topic with attributes.
gcp_pubsub.publish('myservice', 'demo1', {"field1": "abc", "field2": 456},{attributes:{'prop1':'abc'}})
// Send binary message top the topic.
gcp_pubsub.publish('myservice', 'demo1', [0x01, 0x02, 0x03])
The following events are considered billable: