GoogleCloudPlatform / node-red-contrib-google-cloud

Node-RED nodes for Google Cloud Platform
Apache License 2.0
90 stars 57 forks source link

PubSub In as a push endpoint #94

Closed batesenergy closed 3 years ago

batesenergy commented 3 years ago

Thanks for this great node red contribution!

We are using node red in a cloud run container with your PubSub In node. We currently have this working with the PubSub pull functionality but as one would expect it goes dormant after some time. We would like to implement the push functionality but it immediately fails. We have to specify the push endpoint which may be where we are making our mistake?

Screen Shot 2021-04-15 at 8 39 01 AM

Have you ever tried this in cloud run or this node as a push endpoint? Any feedback would be greatly appreciated!

kolban-google commented 3 years ago

I have indeed tested PubSub push. The trick here is to realize you absolutely do NOT need a custom node to handle incoming Push requests. Instead what you want to do is create an HTTPS receiving Node-RED flow. Nothing special from a GCP perspective.

Create a Node-RED flow that listens for incoming HTTPS traffic. When you define the GCP PubSub push definition, point that to the Input node (HTTPS receiver) that Node-RED is listening on. The biggest headache is that you have to configure Node-RED to listen on a valid HTTPS endpoint with a valid SSL certificate.

batesenergy commented 3 years ago

Good point...thanks so much!

kolban-google commented 3 years ago

And please ... don't hesitate to ping back if you need assistance. I'm here to assist with any and all usage of Node-RED as it relates to GCP ... even if that isn't using the nodes found in this package.