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

Create BatchItemFailure structs for DynamoDB, Kinesis, SQS #410

Merged
merged 6 commits into from Jan 7, 2022

Conversation

lyoung-confluent
Copy link
Contributor

@lyoung-confluent lyoung-confluent commented Nov 16, 2021

This change adds the response structs for "reporting batch item failures" documented in:

This is implemented in the Java events SDK as: aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/StreamsEventResponse.java

I don't know that adding a test here has any value, but happy to add one if you'd like.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2021

Codecov Report

Merging #410 (ad4620d) into main (96ab249) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #410   +/-   ##
=======================================
  Coverage   71.66%   71.66%           
=======================================
  Files          19       19           
  Lines        1041     1041           
=======================================
  Hits          746      746           
  Misses        228      228           
  Partials       67       67           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96ab249...ad4620d. Read the comment docs.

@bmoffatt
Copy link
Collaborator

Thanks! This looks applicable for SQS Partial Batch Failures too!
https://aws.amazon.com/about-aws/whats-new/2021/11/aws-lambda-partial-batch-response-sqs-event-source/
https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting

Though it can be used across all 3 event sources, I'm thinking to proactively namespace the structs. eg: define KinesisEventResponse, DynamoDBEventResponse, SQSEventResponse

@carlzogh WDYT?

@carlzogh
Copy link
Contributor

carlzogh commented Dec 8, 2021

Though it can be used across all 3 event sources, I'm thinking to proactively namespace the structs. eg: define KinesisEventResponse, DynamoDBEventResponse, SQSEventResponse

Absolutely, thanks @bmoffatt - we've found it tricky in the Java events library to rename/cater for different event source types that seem similar at first, so accounting for those explicitly from the get-go is a good idea!

@shawnkoon
Copy link
Contributor

Doing a pulse check, would love to see SQSEventResponse implemented.

Though it can be used across all 3 event sources, I'm thinking to proactively namespace the structs. eg: define KinesisEventResponse, DynamoDBEventResponse, SQSEventResponse

Is there a strategy on BatchItemFailure ex) if it should be name spaced to {SQS|Kinesis|DynamoDB|Stream}BatchItemFailure or just keep one BatchItemFailure somewhere? Happy to contribute

@lyoung-confluent lyoung-confluent changed the title Create StreamsEventResponse and BatchItemFailure Create BatchItemFailure structs for DynamoDB, Kinesis, SQS Jan 4, 2022
@lyoung-confluent
Copy link
Contributor Author

I split up the structs (and child item failure structs) into different structs per each service (as well as adding SQS) and updated the description/title accordingly. I kept everything in streams.go instead of individual files though.

@bmoffatt
Copy link
Collaborator

bmoffatt commented Jan 7, 2022

LGTM, thanks!

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

Successfully merging this pull request may close these issues.

None yet

5 participants