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

feat: adding the ability to execute the consumer concurrently #449

Closed
wants to merge 5 commits into from

Conversation

nicholasgriffintn
Copy link
Member

@nicholasgriffintn nicholasgriffintn commented Dec 31, 2023

Note:
This is complete discovery currently, it is not expected that it will work, nor does it...
Please do not attempt to use it.

Resolves #397

Description:

The aim of this PR is to add the ability to execute SQS Consumer concurrently, meaning that it will keep triggering polls past the batch size and while other messages are being processed, up to a concurrent limit.

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?:

Currently, SQS Consumer restricts the amount of messages that can be processed to the batch size from AWS, this means that users are limited to processing a maximum of 10 messages at a time.

Code changes:

  • Added a new constants file that contains an enum for polling status values

  • Added a new option for concurrency that allows the user to configure the limits

  • Split the poll timeout functionality into a new function so it can be called from multiple places

  • Added tracking for the amount of concurrent executions

  • Adjusted the logic to queue a poll while messages are processing.

  • Updated status method to return concurrency and polling status

  • Add a new timeout value option for the amount of time to wait when the concurrent count has been reached (currently this is the normal timeout count, which may be wrong for some users)

  • Add unit/integration tests

  • Check that this works in the real world with a canary release (while still in PR)

  • Our users don't have concurrency right now, how might this affect them? This is most likely a breaking change any way, but we should check that there are no negative effects.

@nicholasgriffintn nicholasgriffintn added this to the 9.0.0 milestone Dec 31, 2023
@nicholasgriffintn nicholasgriffintn modified the milestones: 9.0.0, 10.0.0 Mar 11, 2024
@nicholasgriffintn nicholasgriffintn modified the milestones: 10.0.0, 11.0.0 Mar 21, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2024
@nicholasgriffintn nicholasgriffintn deleted the concurrent-executions branch December 16, 2024 20:07
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.

1 participant