1

I'm having trouble finding information or examples for the following:

Using an Azure service, whether it be Durable Functions or EventGrid or whatever... I want to subscribe to my GCP Pub/Sub service and 'hear' incoming data near real-time.

I've seen an example using Azure Function and timer trigger, but there must be a better way, right? ChatGPT suggested I could use EventGrid to hook into GCP Pub/Sub but I can't find anything that POC's that.

Any suggestions on an architectural pattern to do this?

J Benjamin
  • 4,722
  • 6
  • 29
  • 39
  • For non Azure expert. Can you list the main capacity of the Durable Function and EventGrid? In addition, do you want to consume the PubSub in pull or push mode? – guillaume blaquiere Apr 08 '23 at 20:14

1 Answers1

2

Well, there are a couple of options. Google Pub Sub supports pushing messages and pull subscriptions.

Push subscriptions require a public available https endpoint to push the message to. This could very well be an Http triggered azure function. It gets triggered for each message pushed by the subscription.

A pull subscription requires a continuously running process that actively pulls messages from the subscription. An azure function won't do as they are supposed to be triggered by an event (http request, event grid event, azure queue message etc.) and are short lived. For a pull subscription you could use an azure web job or web app or a container in an Azure Container Apps instance or any other compute offering on Azure.

From a cost perspective point of view, having an http triggered Azure Function with a push subscription might be the best way to deal with your use case.

Peter Bons
  • 26,826
  • 4
  • 50
  • 74