You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/utilities/batch.md
+14-11Lines changed: 14 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -620,6 +620,20 @@ Processing batches from Kinesis works in four stages:
620
620
}
621
621
```
622
622
623
+
### Partial failure mechanics
624
+
625
+
All records in the batch will be passed to this handler for processing, even if exceptions are thrown - Here's the behaviour after completing the batch:
626
+
627
+
***All records successfully processed**. We will return an empty list of item failures `{'batchItemFailures': []}`
628
+
***Partial success with some exceptions**. We will return a list of all item IDs/sequence numbers ``{'batchItemFailures': [{"itemIdentifier": "<id>}]}`
629
+
***All records failed to be processed**. We will raise `BatchProcessingError` exception with a list of all exceptions captured
630
+
631
+
!!! warning
632
+
You will not have access to the **processed messages** within the Lambda Handler; use context manager for that.
633
+
634
+
All processing logic will and should be performed by the `record_handler` function.
635
+
636
+
623
637
<!-- ### IAM Permissions
624
638
625
639
Before your use this utility, your AWS Lambda function must have `sqs:DeleteMessageBatch` permission to delete successful messages directly from the queue.
@@ -688,17 +702,6 @@ You need to create a function to handle each record from the batch - We call it
688
702
689
703
If the entire batch succeeds, we let Lambda to proceed in deleting the records from the queue for cost reasons. -->
690
704
691
-
<!-- ### Partial failure mechanics
692
-
693
-
All records in the batch will be passed to this handler for processing, even if exceptions are thrown - Here's the behaviour after completing the batch:
694
-
695
-
* **Any successfully processed messages**, we will delete them from the queue via `sqs:DeleteMessageBatch`
696
-
* **Any unprocessed messages detected**, we will raise `SQSBatchProcessingError` to ensure failed messages return to your SQS queue
697
-
698
-
!!! warning
699
-
You will not have accessed to the **processed messages** within the Lambda Handler.
700
-
701
-
All processing logic will and should be performed by the `record_handler` function. -->
0 commit comments