Claus Ibsen created CAMEL-26070:
-----------------------------------
Summary: camel-aws-bedrock - aws-bedrock-agent lists the headers
of aws-bedrock-agent-runtime, and no operation fails with a NullPointerException
Key: CAMEL-26070
URL: https://issues.apache.org/jira/browse/CAMEL-26070
Project: Camel
Issue Type: Bug
Components: camel-aws2
Affects Versions: 4.18.0, 4.22.0, 4.23.0
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while adding the catalog body types of aws-bedrock-agent (CAMEL-24961).
h4. 1. The catalog lists the headers of aws-bedrock-agent-runtime
{{BedrockAgentEndpoint}} (main ed3d719b379c, line 38) has {{headersClass =
BedrockAgentRuntimeConstants.class}}, so the catalog and the page of
aws-bedrock-agent list the 26 {{CamelAwsBedrockAgentRuntime*}} headers, and
none of its own: {{CamelAwsBedrockAgentOperation}},
{{CamelAwsBedrockAgentKnowledgeBaseId}}, {{CamelAwsBedrockAgentDataSourceId}},
{{CamelAwsBedrockAgentIngestionJobId}},
{{CamelAwsBedrockAgentIngestionJobStatus}} and
{{CamelAwsBedrockAgentIngestionJobFailureReasons}} ({{BedrockAgentConstants}}).
It has been so since the component was added.
*Proposed change*: {{headersClass = BedrockAgentConstants.class}}. The status
header is set as the {{IngestionJobStatus}} enum, while its javaType says
String.
h4. 2. No operation fails with a NullPointerException
The operation option has no default, and with no CamelAwsBedrockAgentOperation
header, {{switch (determineOperation(exchange))}} ({{BedrockAgentProducer}},
line 48) fails with a NullPointerException. Checked on 4.24.0-SNAPSHOT with
{{camel run}} against a fake of the AWS API that logs the requests it gets.
*Proposed change*: fail with a message that says to set the operation option or
header.
h4. 3. The page describes another component
The page of aws-bedrock-agent gives the URI
{{aws-bedrock-agent-runtime://label}} (line 30), names a
{{bedrockRuntimeClient}} (line 47) and says the component "supports invoking a
supported LLM model" (line 17). It lists neither the three operations nor the
consumer, which gets the ingestion job of the knowledgeBaseId, dataSourceId and
ingestionJobId options and sends it on every poll, also when it did not change
(checked with the fake).
h4. Also read in the code, not run
* The knowledgeBaseId, dataSourceId and ingestionJobId options win over the
headers ({{BedrockAgentProducer}}, lines 112-129), the reverse of
aws-bedrock-agent-runtime and of the other AWS components.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)