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

Message attribute name SQSLargePayloadSize is reserved for use by SQS extended client. #8

Closed raphael-leger closed 2 years ago

raphael-leger commented 4 years ago

For some reason, the following three lines cause the client to crash with the message Message attribute name SQSLargePayloadSize is reserved for use by SQS extended client. sometimes: https://github.com/timothymugayi/boto3-sqs-extended-client-lib/blob/f9a6cff3c20567f671280e599f889baae44ca330/sqs_client/SQSClientExtended.py#L205-L207

Workaround: when removing those lines, I see no more error and everything works as expected every time.

The way I call the send_message method is using the following signature without adding any message attribute: sent_message = sqs.send_message(url, message)

ie. message_attributes should be equal to {} and should not contain the so-called RESERVED_ATTRIBUTE_NAME right? I did not investigate why the above ValueError would be raised from time to time. Just leaving an issue here if anyone wants to go further or encounters the same problem as the workaround is pretty simply to remove this check and exception raise.

aswinramakrishnan commented 4 years ago

were you able to find the issue? I am facing the same issue.

raphael-leger commented 4 years ago

The workaround was to create a file in my project with the same content as the file in this repository: https://github.com/timothymugayi/boto3-sqs-extended-client-lib/blob/master/pysqs_extended_client/SQSClientExtended.py

Except I removed the three lines I talked about: https://github.com/timothymugayi/boto3-sqs-extended-client-lib/blob/f9a6cff3c20567f671280e599f889baae44ca330/sqs_client/SQSClientExtended.py#L205-L207

I am using this file instead of this repository an everything works 👌

jackylee53 commented 3 years ago

just set message_attributes = {} when you use send_message function, like below: sqs.send_message(self.queue_url, content, message_attributes={})

I used it and it works well

puneetsngh commented 3 years ago

Hi added the fix for this open issue https://github.com/timothymugayi/boto3-sqs-extended-client-lib/pull/16

raphael-leger commented 2 years ago

Workaround resolution is here