question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question, a pubsub subscriber that does a http PUSH to a cloud function

See original GitHub issue

Searching through stackoverflow and other google resources wasn’t helping and thought this repo might be a good place to ask my question.

EDIT: I created a stackoverflow question for this - https://stackoverflow.com/questions/49696913/google-pubsub-subscriber-that-does-a-http-push-to-a-cloud-function-in-same-proj. While writing up my question I did find this link - https://stackoverflow.com/questions/44920403/gcp-verify-ownership-of-a-cloud-function-https-endpoint-for-a-pubsub-push. Just not sure if that’s the reason why my situation isn’t working.

Curent question: Is it possible to setup a pubsub topic/subscriber in one project that does a http PUSH to a cloud function in the same OR in another google project? I know there are PubSub triggers but these do not work when the pubsub topic is in another google project.

Error I get is pubsub error INVALID_ARGUMENT if I try to create it. I wasn’t sure if this was because I needed to register the endpoint (https://cloud.google.com/pubsub/docs/push#other-endpoints). However that didn’t feel right because when I create a function, the URL is given to me automatically and I can hit it via Postman.

Thoughts? Did I miss some documentation somewhere?

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
lazharichircommented, Apr 9, 2018

You need to verify this URL by going on your Google Cloud Console, API & Services, Credentials, then the Domain Verification tab. Add the url of your Cloud Functions. You will need to do that for each and every one.

Then, make sure that in the Search Console, you select the META TAG verification method, and response with that on GET requests.

if (req.method === 'GET') {
      // mine is in a settings file but you can hardcode yours for testing purposes
      return res.send(`<html><head><meta name="google-site-verification" content="${settings.google.siteVerificationCode}" /></head><body></body></html>`)
}
3reactions
lazharichircommented, Oct 4, 2018

@lazharichir Is your solution still working? I’m getting the same error after i verified the function domain

Yes, I did it for a new pubsub and GCF yesterday or two days ago and it worked (verify the domain on Search Console, then add to the GCP Domain verification list, and then I can push).

Make sure you use the GCF url with a slash at the end when you create the PUSH subscription as https://.../name-of-function/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Push subscriptions | Cloud Pub/Sub Documentation
In push delivery, Pub/Sub initiates requests to your subscriber application to deliver messages. Key Point: Understand the properties of a push subscription ......
Read more >
Google Pubsub subscriber that does a http PUSH to a cloud ...
Is it possible to setup a pubsub topic/subscriber in one project that does a http PUSH to a cloud function in the same...
Read more >
Can I make google pubsub subscriptions push url a google ...
If you want to set up a Cloud Function as an HTTP endpoint to be triggered by a PubSub push subscription, you can...
Read more >
How to use Google Pub/Sub to build an asynchronous ...
Learn a simple but powerful Cloud Pub/Sub system · We can use the add_done_callback method of the future to add a callback function...
Read more >
Receiving Messages using Push to Cloud Function - ep.8
In this episode of Pub/Sub Made Easy, Priyanka Vergadia speaks to why sending messages via push delivery is so easy.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found