Creating topics and subscriptions with Google Cloud Pub/Sub
We will now provision two topic and subscription pairs. The reason we have two pairs is that we will need to use the dead-letter functionality of Google Cloud Pub/Sub. The dead-letter functionality is to place a message (event) that was not acknowledged as delivered into another topic after a certain number of failed delivery attempts. This means that we are storing each event that could not be processed into that topic, which allows us to correct the problem later. The first pair is for dead letters, and the second pair is for our application to publish and subscribe to.
To create the necessary topic and subscription pairs, we will take the following steps in the cloud console:
- From the navigation menu, click Pub/Sub, as illustrated in the following screenshot:
- On the Topics page, click CREATE TOPIC, as illustrated in the following screenshot: