Max888
Max888

Reputation: 3770

Manually trigger GCP pub sub functions

I have some GCP functions which use pub sub to run on a schedule. I would like to be able to also run them ad hoc. I am positive I was able to do this from the GCP console UI, but for the life of me can't find the button again. Does anyone know how to do this? Or failing that, is it possible to run functions ad hoc with the gcloud command line tool? I know I could deploy them as HTTP functions as well to enable me to hit the HTTP endpoint to trigger the functions, but I don't want to have to deploy all my functions as pub sub as well as HTTP.

Upvotes: 3

Views: 2008

Answers (2)

Daniel Wyatt
Daniel Wyatt

Reputation: 1151

You can do it from the console as well. Click on the topic and then click on +PUBLISH MESSAGE at the top of the window.

You can then write your message in the box and click publish.

Upvotes: 1

Doug Stevenson
Doug Stevenson

Reputation: 317477

You can use gcloud to send a message to a topic. I suggest reading the documentation.

gcloud pubsub topics publish your-topic --message=your-message

Upvotes: 4

Related Questions