Not working in cloud function
See original GitHub issueI am unable to get the client to work in a cloud function. Sometimes messages are never acknowledged (even though ack()
is being called) and the cloud function can get “stuck” where no newly published messages are ever fetched until the cloud function is redeployed.
Reading the cloud function docs, background activities should not be started.
Is the node.js pubsub client not compatible with cloud functions because it sends acknowledgments in the background and re-uses connections from a pool? I have a StackOverflow question asking the same question in more detail.
Thanks!
Environment details
- OS: Google Cloud Function
- Node.js version: 6.11.5
- npm version: not documented by Google
- @google-cloud/pubsub version:
0.16.2
Steps to reproduce
- Create a Google Cloud Function using the pubsub client to pull messages from a subscription
- Deploy the function
- Publish messages, execute the function, and repeat
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:9
Top Results From Across the Web
Troubleshooting Cloud Functions - Google Cloud
Function deployment fails due to Cloud Build not supporting VPC-SC. Cloud Functions uses Cloud Build to build your source code into a runnable...
Read more >android - Cloud Function Not Working - Stack Overflow
I want to add notifications to an online android chatting app I have made. I am new to cloud functions, ...
Read more >Cloud function not working (Billing disabled, shutting down ...
Hello, My cloud function named sendFeedbackNotification is not working. Whenever I am trying to invocate it, I am getting this in log "Billing...
Read more >Get started: write, test, and deploy your first functions - Firebase
To get started with Cloud Functions, try working through this tutorial, which starts with the required setup tasks and works through creating, testing, ......
Read more >Google Cloud Functions and API key not working
I had past my last 8 hours, checking why api key restringion is not working at all. I will try to describe. Google...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
“Sometimes messages are never acknowledged (even though ack() is being called) and the cloud function can get “stuck” where no newly published messages are ever fetched until the cloud function is redeployed.”
I’m currently facing this exact same issue. Is it still the case that the nodejs library should not be used in this way? As it was a few years ago I wonder if there has since been a fix or I should use a different approach.
I wrote an article on our blog discussing in more detail why we use PubSub the way we do (and the challenges we encountered). It may be more clear than my description above.
Don’t hesitate to add any questions or feedback over there also…