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

Cannot send message to cross account FIFO SQS queue #938

Closed
ZhongXiLu opened this issue Nov 3, 2023 · 7 comments
Closed

Cannot send message to cross account FIFO SQS queue #938

ZhongXiLu opened this issue Nov 3, 2023 · 7 comments
Labels
component: sqs SQS integration related issue type: bug Something isn't working

Comments

@ZhongXiLu
Copy link

ZhongXiLu commented Nov 3, 2023

Type: Bug

Component:
SQS

Describe the bug
Whenever I try to send messages to a FIFO SQS queue in another AWS account, it results in following error:
Value ContentBasedDeduplication for parameter Attribute.Name is invalid. Reason: Only owners can access specified attribute.

It seems retrieving the ContentBasedDeduplication queue attribute does not work for a cross-account SQS queue, see https://github.com/awspring/spring-cloud-aws/blob/main/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/operations/SqsTemplate.java#L265.

I'm using spring cloud version 3.0.2.
The bug seems to be introduced since 3.0.1 through this PR: #799.

Sample

SqsTemplate sqsTemplate = SqsTemplate
                .builder()
                .sqsAsyncClient(SqsAsyncClient.create())
                .build();
        
sqsTemplate.send("<other_aws_account_sqs_queue_url>", "test");
@maciejwalkowiak
Copy link
Contributor

@tomazfernandes perhaps we can give users option to configure the value for ContentBasedDeduplication - in such case SQS integration instead of checking the value from real queue attributes would just believe in what user provided?

@maciejwalkowiak maciejwalkowiak added type: bug Something isn't working component: sqs SQS integration related issue labels Nov 6, 2023
@maciejwalkowiak maciejwalkowiak changed the title Cannot send message to cross account fifo queue Cannot send message to cross account FIFO SQS queue Nov 6, 2023
@tomazfernandes
Copy link
Contributor

tomazfernandes commented Nov 6, 2023

@tomazfernandes perhaps we can give users option to configure the value for ContentBasedDeduplication - in such case SQS integration instead of checking the value from real queue attributes would just believe in what user provided?

Sure. From the top of my mind, we could have a ContentDeduplication enum, such as:

ContentDeduplication.ENABLED
ContentDeduplication.DISABLED
ContentDeduplication.AUTO

And then AUTO would be the default so it's not a breaking change.

Makes sense?

@maciejwalkowiak
Copy link
Contributor

It does!

@tomazfernandes
Copy link
Contributor

It does!

Cool!

@ZhongXiLu, what do you think? Would you be interested in opening a PR with this change?

@ZhongXiLu
Copy link
Author

@tomazfernandes Sure, I'll take a look 👍

@tejashwinisubbanna
Copy link

Hi All, After migrating from Spring cloud 2 to 3.0.3.I am getting below error

2023-12-08T11:29:14.838+11:00 ERROR 1 --- [nio-8080-exec-1] c.g.t.d.s.s.SqsDataLoaderMessageSender : Error in calculation java.util.concurrent.CompletionException: io.awspring.cloud.sqs.QueueAttributesResolvingException: Error resolving attributes for queue tie-super-calc20230716111832302200000001.fifo with strategy CREATE and queueAttributesNames [ContentBasedDeduplication]

With spring cloud 2,it was working fine.But after migration,getting above error does anyone has any idea?

tomazfernandes added a commit to tomazfernandes/spring-cloud-aws that referenced this issue Dec 9, 2023
tomazfernandes added a commit to tomazfernandes/spring-cloud-aws that referenced this issue Dec 9, 2023
@tejashwinisubbanna
Copy link

Hi Team,
Could you please let us know when these changes would be available for use?
which version ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: sqs SQS integration related issue type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants