Claus Ibsen created CAMEL-27659:
-----------------------------------

             Summary: camel-aws2-iam: health check region with custom client, 
error message typo, client label
                 Key: CAMEL-27659
                 URL: https://issues.apache.org/jira/browse/CAMEL-27659
             Project: Camel
          Issue Type: Bug
          Components: camel-aws2
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while improving the option descriptions of camel-aws2-iam for CAMEL-23832 
(commit 
https://github.com/apache/camel/commit/a05c676a716a9783fd2fcea8c8e6209a198ddc96).
These are separate problems of the component; the descriptions commit only 
documents the current behavior.

h4. 1. The producer health check uses the region option even with a custom 
iamClient
{{IAM2ProducerHealthCheck.doCall()}} first checks that 
{{Region.of(configuration.getRegion())}} is in 
{{IamClient.serviceMetadata().regions()}}. If it is not, the check reports DOWN 
with "The service is not supported in this region" and does not call IAM.
When a custom or autowired {{iamClient}} is set, the endpoint does not use the 
{{region}} option to build a client. A working client can then be reported DOWN 
because of a region value that has no effect.
Proposed change: skip the region check when {{configuration.getIamClient()}} is 
set, and rely on the {{listAccessKeys}} call.

h4. 2. Typo in the error message of IAM2Component.createEndpoint()
When no credentials and no client are configured, 
{{IAM2Component.createEndpoint()}} throws an {{IllegalArgumentException}} whose 
message starts with {{seDefaultCredentialsProvider is set to false}}. The 
option is {{useDefaultCredentialsProvider}}.
Proposed change: fix the option name in the message.

h4. 3. The iamClient option has no advanced label
{{IAM2Configuration.iamClient}} has {{@Metadata(autowired = true)}} without 
{{label = "advanced"}}, so it is listed with the common producer options. The 
client options of other AWS components, such as aws-security-hub, aws2-athena, 
aws2-eventbridge and aws2-mq, have the {{advanced}} label.
Proposed change: add {{label = "advanced"}}, to match these components.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to