Claus Ibsen created CAMEL-27637:
-----------------------------------
Summary: camel-huaweicloud-functiongraph: null region in URN, WARN
per message, metadata, doc class
Key: CAMEL-27637
URL: https://issues.apache.org/jira/browse/CAMEL-27637
Project: Camel
Issue Type: Bug
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while improving the option descriptions of
camel-huaweicloud-functiongraph for CAMEL-23832 (PR
https://github.com/apache/camel/pull/30971).
These are separate problems of the component; the descriptions PR only
documents the current behavior.
h4. 1. With endpoint set and no region, the function URN contains null
{{ClientConfigurations(FunctionGraphEndpoint)}} accepts an endpoint that has
the {{endpoint}} option set and no {{region}}: it only throws when both are
empty. {{FunctionGraphUtils.composeUrn()}} then builds the URN with
{{clientConfigurations.getRegion()}}, which is null, so the producer calls
FunctionGraph with {{urn:fss:null:<projectId>:function:...}}. The user gets an
error back from FunctionGraph instead of a clear Camel error.
Proposed change: always require {{region}} in {{ClientConfigurations}}, as the
URN needs it even when {{endpoint}} is set, and fail with a message that says
so.
h4. 2. A WARN line for every message without CamelHwCloudFgXCffLogType
{{FunctionGraphProducer.updateClientConfigs()}} logs {{No XCffLogType given}}
at WARN for every message that has no {{CamelHwCloudFgXCffLogType}} exchange
property. The property is optional, and most routes do not set it, so the log
fills with this line.
Proposed change: log it at DEBUG or TRACE, or not at all.
h4. 3. accessKey and secretKey are marked as required
{{accessKey}} and {{secretKey}} in {{FunctionGraphEndpoint}} have
{{@Metadata(required = true)}}, but {{ClientConfigurations}} and
{{FunctionGraphEndpoint.initClient()}} accept the {{serviceKeys}} option in
their place. Tools that read the catalog ask for options that are not needed.
Proposed change: set {{required = false}} on both options, as the descriptions
already say that {{serviceKeys}} replaces them.
h4. 4. serviceKeys has no security label
{{serviceKeys}} in {{FunctionGraphEndpoint}} has {{security = "secret"}} but no
{{label}}, so it is listed under the common options, while {{accessKey}} and
{{secretKey}} have {{label = "security"}}.
Proposed change: add {{label = "security"}} to {{serviceKeys}}.
h4. 5. The doc page names a ServiceKeys class that does not exist
The "Using ServiceKey Configuration Bean" section of
{{hwcloud-functiongraph-component.adoc}} names the class
{{org.apache.camel.component.huaweicloud.functiongraph.models.ServiceKeys}}, in
the text and in the XML bean example. The class is
{{org.apache.camel.component.huaweicloud.common.models.ServiceKeys}}, so the
example fails with a ClassNotFoundException.
Proposed change: use the correct class name in the text and the example.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)