Claus Ibsen created CAMEL-27689:
-----------------------------------
Summary: camel-aws-bedrock: async client credentials check,
listIngestionJobs paging, metadata
Key: CAMEL-27689
URL: https://issues.apache.org/jira/browse/CAMEL-27689
Project: Camel
Issue Type: Bug
Components: camel-aws2
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while improving the option descriptions of camel-aws-bedrock for
CAMEL-23832 (commit
https://github.com/apache/camel/commit/55ddf8001fbc0f38537478ca38d612f93086889b).
These are separate problems of the component; the descriptions commit only
documents the current behavior.
h4. 1. The credentials check ignores the async client
{{BedrockComponent.createEndpoint()}} and
{{BedrockAgentRuntimeComponent.createEndpoint()}} accept only the sync client
({{bedrockRuntimeClient}}, {{bedrockAgentRuntimeClient}}) in place of the
credentials options. An endpoint that sets only {{bedrockRuntimeAsyncClient}}
or {{bedrockAgentRuntimeAsyncClient}} fails with the error "... accessKey and
secretKey must be specified". When only the sync client is set,
{{BedrockEndpoint.doStart()}} (and {{BedrockAgentRuntimeEndpoint}} for the
event-stream operations) builds the async client from the empty credentials
options, so it silently uses the default credentials chain of the AWS SDK
instead of the credentials of the given client.
Proposed change: accept either client in the check, and document (or log) that
the other client is built from the options.
h4. 2. listIngestionJobs gives only the first page
{{BedrockAgentProducer.listIngestionJobs()}} sets neither {{maxResults}} nor
{{nextToken}} on the {{ListIngestionJobsRequest}}, and does not give the
{{nextToken}} of the response. A data source with more ingestion jobs than one
page returns only the first page, and the user cannot get the next one without
pojoRequest=true.
Proposed change: add a next token header (in and out) and a max results header,
as the retrieve operation of aws-bedrock-agent-runtime has with
{{CamelAwsBedrockAgentRuntimeNextToken}}.
h4. 3. profileCredentialsName has defaultValue "false"
In {{BedrockConfiguration}}, {{BedrockAgentConfiguration}} and
{{BedrockAgentRuntimeConfiguration}} the String option
{{profileCredentialsName}} has {{@UriParam(defaultValue = "false")}}, so the
catalog shows a default profile name of "false". The code uses the default
profile of the AWS SDK when it is not set.
Proposed change: remove the defaultValue.
h4. 4. Required flags that do not match the code
* aws-bedrock-agent: {{operation}} is {{required = true}}, but
{{BedrockAgentIngestionJobConsumer}} does not use it, so a valid consumer URI
is reported as missing a required option by tooling.
* aws-bedrock: {{modelId}} is {{required = true}}, but applyGuardrail and
pojoRequest=true do not use it.
Proposed change: make {{operation}} not required (it is required for the
producer only), and consider the same for {{modelId}}.
h4. 5. Wrong client name in the credentials error
{{BedrockAgentComponent.createEndpoint()}} and
{{BedrockAgentRuntimeComponent.createEndpoint()}} throw "... Amazon Bedrock
runtime client or accessKey and secretKey must be specified", which names the
runtime client instead of {{bedrockAgentClient}} or
{{bedrockAgentRuntimeClient}}.
Proposed change: name the option of the scheme in the message.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)