Col
Col

Reputation: 371

Web API to Google Cloud Pub Sub

I'm new to google cloud technologies. If I have a streaming web API online where I want to access JSON data from and write it into Cloud Pub/Sub, Do I need to create a python app engine or something that reads that Web API and writes the data into Cloud Pub/Sub or is there an easier way? Basically just poling a web API and getting JSON data.

Upvotes: 1

Views: 843

Answers (1)

Jean
Jean

Reputation: 129

There's multiple ways that this could be achieved:

Cloud Function: With the help of triggers, you could have the cloud function grab the data and write it to pub/sub using its API Service. Cloud functions uses a Nodejs runtime so you will need to use javascript to code the function.

Direct Stream: You can altogether skip the extra work and simply adapt your web service to use the Pub/Sub API service and write the data directly to it.

You can look into the Pub/Sub Client API Documentation which offer sample and guidance on how to properly use the API.

Hope this is helpful.

Upvotes: 1

Related Questions