timothymugayi / boto3-sqs-extended-client-lib

Boto3 SQS Extended Client Library for Python. An extension to the boto3 sqs client that enables sending and receiving messages up to 2GB via Amazon S3. [WARNING: This library is still under development contributors welcome]
Apache License 2.0
27 stars 23 forks source link

Fix case when message body is a list #15

Closed Izbitzer closed 3 years ago

Izbitzer commented 3 years ago

When message body is e.g. [ "software.amazon.payloadoffloading.PayloadS3Pointer", { "s3BucketName": "my-ssq-bucket", "s3Key": "af678f3c-ac46-4539-94d6-eac3c5e60db4" } ]

message parsing fails due to it not finding the keys "s3BucketName" and "s3Key" in the body.

This commit changes so that we check if the body is a list, and the first element of the list is the string "software.amazon.payloadoffloading.PayloadS3Pointer".

If the body is not a list we fall back to the old behavior.

Fixes #7

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

PR type

Changelog updated

Breaking changes

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

Checklist: