Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Amazon SQS Extended Client Library for Java #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sl2000
Copy link

@sl2000 sl2000 commented Sep 13, 2022

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants