In this section, we will learn how to push a message to a pub/sub topic for the invoice processing system to process the invoice. We will cover the process of creating a pub/sub topic, as well as how to publish and subscribe to messages from the topic.
Let's create a topic and test it:
- To enable the Cloud Pub/Sub API, go through the following steps:
- Search for the Pub/Sub API from the home page.
- Enable the API.
- To create a pub/sub topic and subscription, go through the following steps:
- Select Pub/Sub from the left panel.
- Click on Create Topic.
- From the left panel, go to Subscriptions and create a subscription for the created topic.
- From the option shown in the following screenshot, ...