import json
import boto3
from datetime import datetime
client = boto3.client('sqs')
queue = "<https://sqs.ap-northeast-2.amazonaws.com/323974325951/asd.fifo>"
def lambda_handler(event, context):
response = client.receive_message(
QueueUrl=queue,
MaxNumberOfMessages=1,
WaitTimeSeconds=15,
)
message = response["Messages"][0]
message_body = message["Body"]
receipt_handle = message['ReceiptHandle']
print(message_body)
dlt_response = client.delete_message(
QueueUrl=queue,
ReceiptHandle=receipt_handle
)
message_body
receipt_handle