-
-
Save zdotfive/854541e4eaff5acfdd6ecc5a9cf97387 to your computer and use it in GitHub Desktop.
This file contains 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
import os | |
import json | |
import boto3 | |
def lambda_handler(event, context): | |
if event: | |
messages_to_reprocess = [] | |
batch_failure_response = {} | |
for record in event["Records"]: | |
try: | |
body = record["body"] | |
# process message | |
except Exception as e: | |
messages_to_reprocess.append({"itemIdentifier": record['messageId']}) | |
batch_failure_response["batchItemFailures"] = messages_to_reprocess | |
return batch_failure_response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment