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

AWS2 components have to set client.endpointOverride() to work on Localstack #2216

Closed
ppalaga opened this issue Feb 8, 2021 · 6 comments · Fixed by #2596
Closed

AWS2 components have to set client.endpointOverride() to work on Localstack #2216

ppalaga opened this issue Feb 8, 2021 · 6 comments · Fixed by #2596
Labels
Milestone

Comments

@ppalaga
Copy link
Contributor

ppalaga commented Feb 8, 2021

This holds at least for the AWS2 SQS component (and does not hold for at least AWS2 S3 component which already has the camel.component.aws2-s3.uri-endpoint-override option). The symptoms and fix are described in localstack/localstack#1318 .

This needs to be fixed in Camel, but I am filing it here for now because I need to figure out which components are affected.

@oscerd
Copy link
Contributor

oscerd commented Feb 8, 2021

Maybe you need to have a look at test-infra folder on main camel. There is the possibility to re-use that stuff in quarkus too. The endpoint override can be added to the components where it makes sense, but if it is just for the sake of testing, I think it worths to look at how the tests are done in main camel repo.

It may be I don't get the issue, but all the test suite in camel for aws2 is using localstack and the endpoint override mechanism has been implemented only on kinesis and s3. So I believe it is not mandatory.

@ppalaga
Copy link
Contributor Author

ppalaga commented Feb 9, 2021

Maybe you need to have a look at test-infra folder on main camel. There is the possibility to re-use that stuff in quarkus too.

Thanks for the pointer, I was not aware of Localstack being used there.

As far as I can see, Localstack is integrated via a custom client set in the component config https://github.com/apache/camel/blob/master/components/camel-aws2-sns/src/test/java/org/apache/camel/component/aws2/sns/localstack/Aws2SNSBaseTest.java#L38

That's a bit complicated, IMO. Having uri-endpoint-override on all AWS2 components would make the testing easier in Camel Quarkus. It is because in that way, we can set it from the TestResource which declares the environment for the test app. While it is easy to set a primitive type property (such as uri-endpoint-override), it is impossible to pass an object (such as custom client), because the TestResource may potentially run in a process distinct from the test app.

While adding uri-endpoint-override options to all AWS2 component is my preference, I still acknowledge that testing-only options might be seen as polluting the API. So I am open to other proposals or even adopting the custom client approach on the Camel Quarkus side.

@oscerd
Copy link
Contributor

oscerd commented Feb 9, 2021

If we look at this from the perspective of having some configuration features parity in all the AWS2 components, it makes sense to have the uri override approach in all the components. In terms of effort I think it is less work on the camel side than doing the stuff on quarkus, in the end we are talking about two endpoint options for components. Can you create an issue on Camel JIRA for this and assign it to me? For 3.9 I'll have some work to do, like removing the camel-aws components and focus on AWS2 ones, so I'll have time to add the options.

@ppalaga
Copy link
Contributor Author

ppalaga commented Feb 9, 2021

@ppalaga ppalaga added the test label Apr 1, 2021
@ppalaga
Copy link
Contributor Author

ppalaga commented Apr 1, 2021

Since Camel 3.9.0 all AWS 2 components have uri-endpoint-override (thanks, @oscerd !) and we can leverage it Camel Quarkus.

@oscerd
Copy link
Contributor

oscerd commented Apr 1, 2021

Happy to help :-)

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

Successfully merging a pull request may close this issue.

2 participants