john
john

Reputation: 131

How To Get Google Event Messages From Pub/Sub service in terminal?

Is there a command to get the Message body as shown in the Google Cloud Platform Console Subscriptions (relating to event triggers from Nest Doorbell Device) in the terminal?

If not, how can I make an API request to the Pub/Sub service and receive the same JSON Payload shown in the GCP Console?

Thanks

Upvotes: 0

Views: 1114

Answers (1)

John Hanley
John Hanley

Reputation: 81336

You can use the gcloud CLI to view subscription messages. Just do not ack the message so that it will continue to be delivered to subscribers.

Note: I do not work with the Nest doorbell, so I cannot comment on their interface. The following is specific to the Pub/Sub service.

gcloud pubsub subscriptions pull

You can do the same thing with the REST API or one of the SDKs.

REST API: Method: projects.subscriptions.pull

SDK: Receiving messages using Pull

Upvotes: 1

Related Questions