Skip to content

Enable --retry flag for background functions #131

Closed
@0xkalle

Description

@0xkalle

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions