Skip to content

Instantly share code, notes, and snippets.

@richardgrantserverless
Created May 31, 2022 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardgrantserverless/081d548005399fce3dfcbeb76998137a to your computer and use it in GitHub Desktop.
Save richardgrantserverless/081d548005399fce3dfcbeb76998137a to your computer and use it in GitHub Desktop.
# 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