Why small businesses need a website in 2019?

Consider your personal search habits. When you need a nonessential product such as a candle, or are on vacation and need to find a restaurant near you, what do you do? You turn to Google, conduct a…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Subscribing to Google PubSub Topics with Spring Boot GCP

This will be my pom.xml

From the side menu in Google Cloud console, select IAM & Admin -> Service Accounts .

Click on ⋮ next to the service account with the name “App Engine default service account”, then select Create key.

In the next window, select JSON as the Key type and click CREATE. A Json file will be downloaded to your computer. Copy the file to a folder you prefer.

In your Spring Boot application, create an application.properties file in the resources folder, then add the following. Replace project-Id with your Google Cloud project id and replace path-to-json-file with path to the Json file you just downloaded.

Create a Config file and add the following code. Replace subscription-name with the name you gave to your subscription in our previous article.

In the main class, add the below. Here DemoApplication is my main class. This will log the messages received from PubSub to your console. Actually, these messages are the Conversation History from your Dialogflow chatbot.

Add a comment

Related posts:

Vitamin D

The weeks are going faster and faster as the semester goes on, it’s crazy to me how it’s already Friday! I think a lot of that has to do with more assignments piling up and more studying to do, but I…

The Role of Gutter Cleaning in Preventing Foundation Damage and Basement Flooding

Heavy rain pouring down, water cascading off the roof, and your gutters working silently in the background, protecting your home’s foundation from potential damage. The importance of gutters to your…

Engineering at TenX

Our first engineering blog post - on our journey towards microservices!