Skip to content
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

Support for SQS partial batch response #667

Closed
ryanwalters opened this issue Jan 31, 2023 · 2 comments
Closed

Support for SQS partial batch response #667

ryanwalters opened this issue Jan 31, 2023 · 2 comments

Comments

@ryanwalters
Copy link

ryanwalters commented Jan 31, 2023

Do you think it would be possible to add support for partial batch responses for lambdas with SQS event sources?

Here is a little more documentation on the feature, as well as the bit of CloudFormation needed to enable it.

From the Serverless plugin side of things, I defer to you to decide what is best obviously, but I picture something like this:

functions:
  processEvent:
    handler: handler.handler
    events:
      - snsSqs:
          name: TestEvent # Required - choose a name prefix for the event queue
          topicArn: !Ref Topic # Required - SNS topic to subscribe to
          reportBatchItemFailures: true # Optional - defaults to false

Great project by the way!

@janos-kasa
Copy link

@ryanwalters you can do it with eventSourceMappingOverride:

functions:
  processEvent:
    handler: handler.handler
    events:
      - snsSqs:
          name: TestEvent # Required - choose a name prefix for the event queue
          topicArn: !Ref Topic # Required - SNS topic to subscribe to
          eventSourceMappingOverride:
            functionResponseTypes:
              - ReportBatchItemFailures

@NoxHarmonium
Copy link
Collaborator

Thanks for your interest @ryanwalters and for your answer @janos-kasa!

@janos-kasa has the right approach, we were originally mapping through each parameter one-by-one as people found missing functionality and eventually realised that we should just directly pass through CF config for the event source mapping (a la #213) which is more future proof.

I'll mark this issue as solved.

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

No branches or pull requests

3 participants