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

SQS - Dedup messages in a batch when using deleteMessageBatch #5950

Closed
1 of 2 tasks
shyam2794 opened this issue Mar 31, 2024 · 2 comments
Closed
1 of 2 tasks

SQS - Dedup messages in a batch when using deleteMessageBatch #5950

shyam2794 opened this issue Mar 31, 2024 · 2 comments
Assignees
Labels
feature-request New feature or enhancement. May require GitHub community feedback.

Comments

@shyam2794
Copy link

Describe the feature

Remove the duplicate messages within a single batch when deleting in sqs.

This has been handled in the aws sdk for ruby - https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-sqs/lib/aws-sdk-sqs/queue_poller.rb#L434

aws/aws-sdk-ruby#2908 (comment)

PR - aws/aws-sdk-ruby#2918

Use Case

When there are messages with same id in a single batch , deletion fails with the error BatchEntryIdsNotDistinct . This is already handled in AWS SDK ruby , we can do the same for js as well .

Proposed Solution

From AWS docs ,

If you receive a message more than once, each time you receive it, you get a different receipt handle. You must provide the most recently received receipt handle when you request to delete the message (otherwise, the message might not be deleted).

We could reverse the order of message Id's remove the duplicate and reverse the message to the original order . This should retain the duplicate message with recent receipt handle .

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

v3

Environment details (OS name and version, etc.)

All OS

@shyam2794 shyam2794 added feature-request New feature or enhancement. May require GitHub community feedback. needs-triage This issue or PR still needs to be triaged. labels Mar 31, 2024
@shyam2794 shyam2794 changed the title (short issue description) SQS - Dedup messages in a batch when using deleteMessageBatch Mar 31, 2024
@RanVaknin RanVaknin self-assigned this Apr 5, 2024
@RanVaknin
Copy link
Contributor

RanVaknin commented Apr 5, 2024

Hi @shyam2794 ,

Thanks for reaching out. I have raised this with the SDK team and we have decided that we have no plans implementing this for multiple reasons.

  1. SDKs have moved away from customizations exactly for this reason. Unless there is a unified, customer driven, cross SDK feature request that standardizes high level libraries (for example lib-storage or lib-dynamo) implementing features on a per SDK level can create feature parity gaps.

  2. Since this would be a handwritten customization (not code generated unlike 95% of the SDK), this means we will have to port it over to the next major version otherwise will cause feature parity between the two major versions.

The solution here is to write a helper function to dedupe the batch list yourself.

Thanks again,
Ran~

@RanVaknin RanVaknin removed the needs-triage This issue or PR still needs to be triaged. label Apr 5, 2024
@RanVaknin RanVaknin closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request New feature or enhancement. May require GitHub community feedback.
Projects
None yet
Development

No branches or pull requests

2 participants