-
Notifications
You must be signed in to change notification settings - Fork 421
feat(batch): new BatchProcessor for SQS, DynamoDB, Kinesis #886
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
Merged
heitorlessa
merged 33 commits into
aws-powertools:develop
from
heitorlessa:feat/batch-new-processor
Dec 19, 2021
Merged
Changes from 19 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
b1ca7f1
feat(batch): new BatchProcessor for SQS, DynamoDB, Kinesis
heitorlessa 113a44f
refactor: response over report
heitorlessa 5ab2ec7
fix: mutability bug
heitorlessa 4652237
feat(batch): add Kinesis Data streams support
heitorlessa 4cfcd34
fix: item identifier key should be constant
heitorlessa 139f52b
feat(batch): add DynamoDB Streams support
heitorlessa 1822456
feat(batch): use event source data classes by default
heitorlessa c757316
chore: permanent exceptions TBD in separate PR
heitorlessa 3217097
feat: mypy support
heitorlessa 09257ba
feat: draft implementation
heitorlessa 251541c
fix: mypy typing
heitorlessa 4c95d39
chore: improve mypy support on success/failure
heitorlessa 7756d2c
fix: failure handler record types
heitorlessa 1b242eb
fix: copy data not pointer if one subclasses it
heitorlessa 4a7ceea
chore: linting
heitorlessa 53b8e75
chore: address Tom's feedback on type name
heitorlessa b0f170e
chore: test model support
heitorlessa 01eb5a7
Merge branch 'develop' of https://github.com/awslabs/aws-lambda-power…
heitorlessa 77a7ab5
chore: remove leftovers
heitorlessa 11ab825
docs: new BatchProcessor for SQS, Kinesis, DynamoDB
heitorlessa 0d5d24e
fix: ensure BatchProcessorError is raised when entire batch fails
heitorlessa e1dc4cf
fix: exception leftover
heitorlessa cf3b01a
chore: cleanup exceptions
heitorlessa 3fc3e40
docs: update mechanics section
heitorlessa 9ceb74b
docs: update IAM permission
heitorlessa be8ab03
docs: keep old section name for stats
heitorlessa 27f2937
docs: update accessing processed messages section
heitorlessa 1496b6f
docs: update sentry section
heitorlessa 9057791
docs: add extension, update create own processor
heitorlessa 580eeae
docs: add pydantic section
heitorlessa f380f57
docs: add migration guide
heitorlessa 58d78ca
docs: add caveat section
heitorlessa 95715d0
docs: add testing section
heitorlessa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to have separate processors for each event type (SQS, DynamoDB or Kinesis) instead of growing the complexity of this class? Then you could encapsulate the failure collection in the specific processor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the initial version we wanted to implemented - a KinesisDataStreamProcessor, DynamoDB... then @cakepietoast argued that this was gonna confuse customers with other available processors (Sqs, PartialProcessor, BaseProcessor), as we can only deprecate them in v2.
I'm 50/50 here if I'm honest. I prefer a separate one but I also can see customers easily confused of which one to pick despite docs change I'm gonna make.
Implementation wise, this will remain stable. The only two changes I can anticipate is 1/ supporting the new Permanent Exception parameter, and 2/ raising a descriptive exception in case we reach an AttributeError when collecting message id/sequence number from a malformed event/model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we changed the nomenclature to be “producer” and “consumer” (these processors would be consumers). I had that other idea earlier to make it easier to use the SQS and DynamoDB batch write methods taking into account their batch sizes, those could be “producers” 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would the producer sit and what would be its responsibilities?
For that suggestion on partitioning, we should add it to the Event Source Data Class as it's a no brainier.
I think the word Consumer wouldn't be explicit enough on the capabilities Batch provide - maybe something else then?
Features