@@ -27,6 +27,7 @@ def send_message(record):
2727 sqs_client = boto3 .client ("sqs" )
2828 try :
2929 # Send the record to the queue
30+ print (f"Sending record to DLQ: { message_body } " )
3031 sqs_client .send_message (QueueUrl = failure_queue_url , MessageBody = json .dumps (message_body ))
3132 logger .info ("Record saved successfully to the DLQ" )
3233 except ClientError as e :
@@ -58,7 +59,7 @@ def handler(event, context):
5859 response = str ()
5960 imms_id = str ()
6061 operation = str ()
61- if record ["eventName" ] != "REMOVE " :
62+ if record ["eventName" ] != "DELETE " :
6263 new_image = record ["dynamodb" ]["NewImage" ]
6364 imms_id = new_image ["PK" ]["S" ].split ("#" )[1 ]
6465 supplier_system = new_image ["SupplierSystem" ]["S" ]
@@ -73,15 +74,15 @@ def handler(event, context):
7374 logger .info (f"Record from DPS skipped for { imms_id } " )
7475 return {"statusCode" : 200 , "body" : f"Record from DPS skipped for { imms_id } " }
7576 else :
76- operation = "REMOVE "
77+ operation = "DELETE "
7778 new_image = record ["dynamodb" ]["Keys" ]
7879 logger .info (f"Record to delta:{ new_image } " )
7980 imms_id = new_image ["PK" ]["S" ].split ("#" )[1 ]
8081 response = delta_table .put_item (
8182 Item = {
8283 "PK" : str (uuid .uuid4 ()),
8384 "ImmsID" : imms_id ,
84- "Operation" : "REMOVE " ,
85+ "Operation" : "DELETE " ,
8586 "VaccineType" : "default" ,
8687 "SupplierSystem" : "default" ,
8788 "DateTimeStamp" : approximate_creation_time .isoformat (),
0 commit comments