Skip to content

Instantly share code, notes, and snippets.

@richardgrantserverless
Created May 31, 2022
Embed
What would you like to do?
# service.py
import json
import os
import boto3
def handle_failed_record(record, exception):
queue_url = os.environ['DEAD_LETTER_QUEUE']
message_body = {
'record': record,
'exception': str(e)
}
client = boto3.client('sqs')
client.send_message(
QueueUrl=queue_url,
MessageBody=json.dumps(body)
)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment