search cancel

Service Virtualization DevTest - Publish a message on Google Cloud PubSub Topic

book

Article ID: 189948

calendar_today

Updated On:

Products

CA Application Test Service Virtualization

Issue/Introduction

Have a requirement to publish a message on Google Cloud PubSub Topic from DevTest.

But I did not find any option to do the same in DevTest.

Can you please provide us some feature or help in resolving this issue as we have to develop a virtual service which has to publish a message on PubSub Topic.

Have project_Id and Topic_Id and the message to be published.




Environment

All supported DevTest releases.

Cause

N/A

Resolution

Have not used it but the documentation is here https://cloud.google.com/pubsub/docs/publisher

You could create a JavaScript step and execute it.

You will need Credentials from Google sample script we got from:

https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/publish?apix_params=%7B%22topic%22%3A%22projects%2Fdemos-esd-ct-presales%2Ftopics%2FCT-GC-Test-Pub-Sub%22%2C%22resource%22%3A%7B%22messages%22%3A%5B%7B%22attributes%22%3A%7B%22name%22%3A%22wrench%22%2C%22mass%22%3A%221.3kg%22%2C%22count%22%3A%223%22%7D%7D%5D%7D%7D


See attached file Google-Pu-SubJS.txt

It is really just a REST call, but the Oath means you have to get a Token first.

Rename to Google-Pu-SubJS.txt to Google-Pu-SubJS.js

But it is just a sample not a solution.

If this does not work, suggest you post this requirement on the Service Virtualization Communities forum:

https://community.broadcom.com/enterprisesoftware/communities/communityhomeblogs?CommunityKey=94bda077-625b-4914-8ac3-c88a06c2cc23


Attachments

1588343768118__Google-Pu-SubJS.txt get_app