Compatibility with Amazon SQS Extended Client Library for Java #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi. Thanks for developing this fab library.
I've got a Node.js client that needs to interact with a server using Python. The equivalent Python library to this one https://github.com/timothymugayi/boto3-sqs-extended-client-lib and the Java client https://github.com/awslabs/amazon-sqs-java-extended-client-lib/ use a different format for messages using S3 to this Node.js client.
So I've added an option compatibleMode which if set to true then....
For sendMessage it uses the Java format - with a numeric attribute ExtendedPayloadSize and the message body changed to a JSON object with the S3 bucket name and key - e.g.:
Attribute: ExtendedPayloadSize Number 424699
Body: {"s3BucketName": "bucket.name", "s3Key": "b03530d9-fae4-493b-a48e-3e1ea969bf1d"}
For receiveMessage it accepts either the original Node.js format or the Java format (and for Java format accepts either ExtendedPayloadSize or SQSLargePayloadSize as the flagging attrribute).
I've also added an option useS3AttributeName allowing the attribute used to be changed - for compatibility with the Python client which still uses SQSLargePayloadSize instead of ExtendedPayloadSize.
With compatibleMode and useS3AttributeName not set then the library behaves as before.
I've not added tests for these new options. Could do if pull request accepted.
(I raised issue #5 about this when I thought it was just the attribute name that was different.)