Skip to content

Enable --retry flag for background functions #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
0xkalle opened this issue Nov 2, 2018 · 2 comments · Fixed by #247
Closed

Enable --retry flag for background functions #131

0xkalle opened this issue Nov 2, 2018 · 2 comments · Fixed by #247

Comments

@0xkalle
Copy link

0xkalle commented Nov 2, 2018

I started using Google Cloud Functions to subscribe to a pub/sub topic. The problem is, that by default Pub/Sub messages are acknowledged on receive and not when the function executed successfully.

If I would use the gcloud CLI for the deployment of the function, I would add the --retry flag.

Is it somehow possible to do that now?

As it is not possible to include this in the serverless.yml yet, I would suggest something like this:

functions:
  handlerNameFunction:
    handler: handlerName
    events:
      - event:
          eventType: providers/cloud.pubsub/eventTypes/topic.publish
          resource: projects/:projectId/topics/:topic
          retry: true

with a default to false

or if we want to be able to also add future flags:

functions:
  handlerNameFunction:
    handler: handlerName
    events:
      - event:
          eventType: providers/cloud.pubsub/eventTypes/topic.publish
          resource: projects/:projectId/topics/:topic
          flags:
            - retry
  1. Is there a way to sneak this flag in already?
  2. What do you think of the suggested addition?

Best,
Kalle

@FBosler
Copy link

FBosler commented Sep 9, 2020

Any news on this?

@elyobo
Copy link

elyobo commented Jan 7, 2021

Maybe this behaviour has changed? I notice that the signature shown for pubsub handlers in serverless does not match the signature shown in Google's examples as well.

I like the extensible flags: array option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants