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

chore: upgrade @aws-sdk/client-sqs to version which supports sqs json protocol #440

Merged
merged 11 commits into from
Nov 24, 2023

Conversation

petrisorciprian-vitals
Copy link
Contributor

@petrisorciprian-vitals petrisorciprian-vitals commented Nov 15, 2023

Description:
Updates the aws sdk to a version which supports the AWS SQS JSON protocol.

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Why is this change required?:
It enables better performance due to usage of the AWS SQS JSON communication protocol instead of the AWS SQS Query protocol between client and server.

Code changes:

  • update of dependencies

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@petrisorciprian-vitals petrisorciprian-vitals marked this pull request as draft November 15, 2023 07:25
@petrisorciprian-vitals
Copy link
Contributor Author

petrisorciprian-vitals commented Nov 15, 2023

The localstack upgrade is required since the previous version did not support the SQS JSON protocol as it was old; only the 'latest' tagged image seems to work properly (localstack/localstack#9607).

The healthcheck path and init script path also changed with in more recent versions of localstack and it is also unnecessary to mount a tmp dir.

More recent versions of docker also have a 'compose' subcommand instead, so I updated the initIntTest.sh script for that; let me know if this is somehow breaking in CI or something.

This change should be fully compatible with AWS SQS APIs, it's only in localstack that issues appear.

The benefit of this update is that "based on AWS performance tests for a 5KB message payload, JSON protocol for Amazon Simple Queue Service reduces end-to-end message processing latency by up to 23% and reduces application client side CPU and memory usage."

@petrisorciprian-vitals petrisorciprian-vitals marked this pull request as ready for review November 15, 2023 20:54
@nicholasgriffintn
Copy link
Member

Our CLA check is broken for some reason so I'll just have to do that manually...

Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment reply with the following:""

"I have read the CLA Document and I hereby sign the CLA"

@dciprian-petrisor
Copy link

I have read the CLA Document and I hereby sign the CLA

Copy link

codeclimate bot commented Nov 16, 2023

Code Climate has analyzed commit 9d8cc91 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 98.2% (0.0% change).

View more on Code Climate.

src/consumer.ts Outdated Show resolved Hide resolved
test/scripts/docker-compose.yml Outdated Show resolved Hide resolved
test/scripts/docker-compose.yml Outdated Show resolved Hide resolved
@nicholasgriffintn
Copy link
Member

To note: This would require a major version of the package as the new version of aws-sdk is breaking against anything that's expects the XML protocol.

@nicholasgriffintn nicholasgriffintn added this to the 8.0.0 milestone Nov 16, 2023
Localstack V2 deprecated the HOST_TMP_FOLDER and DATA_DIR envs. The DATA_DIR env was replaced with a PERSISTENCE env, but that is a paid feature of localstack now.
@petrisorciprian-vitals
Copy link
Contributor Author

@nicholasgriffintn
I've pushed a new commit which removes some obsolete envs from the localstack service in docker-compose.yml
See https://docs.localstack.cloud/references/configuration/#legacy for details.

The localstack healthcheck endpoint now gives back a JSON object with a status for each service. This change makes it so that the healthcheck passes if the SQS service is in 'running' state.
@nicholasgriffintn
Copy link
Member

Hey thanks for the updates and sorry, I've been super busy this week, I'm gonna slot some time to look into this on Friday hopefully, if not before.

Copy link

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (nicholasgriffintn)[https://github.com/nicholasgriffintn]
@petrisorciprian-vitals
You can retrigger this bot by commenting recheck in this Pull Request

@nicholasgriffintn
Copy link
Member

CLA Assistant Lite bot: Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.

I have read the CLA Document and I hereby sign the CLA

1 out of 2 committers have signed the CLA.✅ (nicholasgriffintn)[https://github.com/nicholasgriffintn]❌ @petrisorciprian-vitalsYou can retrigger this bot by commenting recheck in this Pull Request

This was signed here: #440 (comment)

Destroyed previously created lock and re ran to ensure it's BBC generated.
Copy link
Member

@nicholasgriffintn nicholasgriffintn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's shipping time

@nicholasgriffintn nicholasgriffintn merged commit 32f6f1e into bbc:main Nov 24, 2023
8 of 9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants