Google PubSub
Google PubSub is a service that makes it easier to pass messages between machines and collect data from IoT devices.
The component interacts with Google Pub-Sub API. The API is an asynchronous messaging service that decouples services that produce events from services that process events. Pub/Sub offers durable message storage and real-time message delivery with high availability and consistent performance at scale. Pub/Sub servers run in all Google Cloud regions around the world.
|
Be aware of the idempotency of your processing flow. Below is an extract from the PubSub Subscriber Guide:
— Google PubSub Subscriber Guide
|
Requirements
Core concepts
- Topic
-
A named resource to which publishers send messages.
- Subscription
-
A named resource representing the stream of messages from a specific topic to be delivered to the subscribing application. Read the Subscriber guide documentation for more information.
- Message
-
The combination of data and, optionally, attributes that a publisher sends to a topic eventually delivers to subscribers.
- Message attribute
-
A key-value pair that a publisher can define for a message. For example, the key
iana.org/language_tagand the valueencould be added to messages to mark them as readable by an English-speaking subscriber.
Credentials
-
Project ID
-
Client E-Mail
-
Private Key
| Google provides a JSON file that includes your private key. Be careful using the information. |
Follow the instructions use your credentials:
-
Copy and paste the private key.
-
Remove any line breakers (
\n) from your key. -
Leave the two lines shown below as they are:
-----BEGIN PRIVATE KEY----- YOUR KEY HERE -----END PRIVATE KEY-----
Authentication
PubSub component authentication works with Google IAM Service Accounts and two-legged OAuth. To authenticate your component, you need to create a new Service Account on the Service Accounts page of your project and download the JSON file with the private key.
You must have client_email and private_key values on the component authentication page.
Read the Using JWT service tokens documentation for more information.
| The authentication mechanism requires access to the topics in your account to read and publish. Verifications will fail if your created service account has no read permission (to subscribe as a trigger function). Save the credential without verification and use it for publishing to the topics (as an action function). |