Reputation: 2301
I have a pub/sub topic that I wish to consume from a single cloud function that is deployed in multiple regions. The behaviour that I observe is that all messages get consumed by a single function (ie they all get consumed in one region).
Is there a reason that messages are not being distributed and consumed in other regions?
Upvotes: 1
Views: 437
Reputation: 17216
It is not possible to have a cross-region Pub/Sub trigger with Cloud Functions given that the service is regional. What this means is that even if the same function is deployed to different regions, they are completely independent. However, if they have the exact same name, then only the first Function created will actually receive messages because the subscription name is unique per Cloud Function name and will be tied to this first deployment. If the functions have different names, then every deployment will create a unique subscription and receive the full stream of messages. We are looking at ways to improve this experience.
Upvotes: 2