Skip to content

Commit 3fc3e40

Browse files
committed
docs: update mechanics section
1 parent cf3b01a commit 3fc3e40

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

docs/utilities/batch.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,20 @@ Processing batches from Kinesis works in four stages:
620620
}
621621
```
622622

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+
623637
<!-- ### IAM Permissions
624638
625639
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
688702
689703
If the entire batch succeeds, we let Lambda to proceed in deleting the records from the queue for cost reasons. -->
690704

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. -->
702705

703706
## Advanced
704707

0 commit comments

Comments
 (0)