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
+50-21Lines changed: 50 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -707,39 +707,68 @@ You need to create a function to handle each record from the batch - We call it
707
707
708
708
## Advanced
709
709
710
-
<!--### Choosing between decorator and context manager
710
+
### Accessing processed messages
711
711
712
-
They have nearly the same behaviour when it comes to processing messages from the batch:
712
+
Use the context manager to access a list of all returned values from your `record_handler` function.
713
713
714
-
* **Entire batch has been successfully processed**, where your Lambda handler returned successfully, we will let SQS delete the batch to optimize your cost
715
-
* **Entire Batch has been partially processed successfully**, where exceptions were raised within your `record handler`, we will:
716
-
* **1)** Delete successfully processed messages from the queue by directly calling `sqs:DeleteMessageBatch`
717
-
* **2)** Raise `SQSBatchProcessingError` to ensure failed messages return to your SQS queue
### Choosing between decorator and context manager
769
+
770
+
Use context manager when you want access to the processed messages or handle `BatchProcessingError` exception when all records within the batch fail to be processed.
0 commit comments