Setup Guide
This guide walks you through creating a Google Cloud project, enabling the Pub/Sub API, and generating a service account key to authenticate the connector.
Prerequisites
- A Google Cloud account. If you do not have one, sign up for a free account.
Step 1: Create a Google Cloud project
- Go to the Google Cloud Console.
- Select the project drop-down and select New Project.
- Enter a project name and select Create.
- Note your project ID — you will need it for configuration.
Step 2: Enable the Pub/Sub API
- In the Google Cloud Console, navigate to APIs & Services > Library.
- Search for Cloud Pub/Sub API and select it.
- Select Enable.
Step 3: Create a service account and download the key
- Navigate to IAM & Admin > Service Accounts and select Create Service Account.
- Enter a name (for example,
pubsub-connector) and select Create and Continue. - Assign the Pub/Sub Editor role (or assign Pub/Sub Publisher and Pub/Sub Subscriber separately for least-privilege access).
- Select Done.
- Select the newly created service account, then go to the Keys tab.
- Select Add Key > Create new key > JSON > Create.
- Save the downloaded JSON key file securely — you will need the path to this file for authentication.
warning
The JSON key file grants access to your Google Cloud resources. Treat it like a password and do not commit it to source control.
Step 4: Create a topic
- Navigate to Pub/Sub > Topics and select Create Topic.
- Enter a Topic ID (for example,
my-topic). - Select Create.
Step 5: Create a subscription
- Navigate to Pub/Sub > Subscriptions and select Create Subscription.
- Enter a Subscription ID (for example,
my-subscription). - Select the topic you created in the previous step from the drop-down.
- Set the delivery type to Pull.
- Select Create.
note
The subscription ID you set here is the value used in the @pubsub:ServiceConfig annotation's subscription field.