Fix #1938: add an AWS Bedrock Agent sink Kamelet - #2997
Conversation
The catalog already covers aws-bedrock (aws-bedrock-text-sink) and
aws-bedrock-agent-runtime (aws-bedrock-agent-runtime-sink). The
aws-bedrock-agent component had no Kamelet, which is the gap this closes:
managing the data source ingestion jobs of a knowledge base via
startIngestionJob, listIngestionJobs and getIngestionJob.
BedrockAgentProducer.determineOperation reads CamelAwsBedrockAgentOperation
from the message before falling back to the endpoint, and knowledgeBaseId
and dataSourceId are header-overridable the same way. A sink that pins
those three as properties therefore has to strip the family, or an inbound
header could redirect the call to a different knowledge base or a different
operation. Same shape as the aws-ec2-sink strip.
CamelAwsBedrockAgentIngestionJobId is excluded from the strip: it is the
one input the Kamelet deliberately takes from the message, since
getIngestionJob has to name a job.
Marked Preview, no Citrus test: exercising this needs a real Bedrock
knowledge base and there is no emulator for it in the project's toolchain.
Verified with `camel run` against the real component -- the route starts
with every parameter bound -- and the strip verified with the terminal
endpoint swapped for a log:
in: Operation=listIngestionJobs, KnowledgeBaseId=attacker-kb,
DataSourceId=attacker-ds, IngestionJobId=job-42, keepMe=yes
out: CamelAwsBedrockAgentIngestionJobId=job-42, keepMe=yes
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
KameletsCatalogTest.testGetKameletsByNamespace asserts an exact count for the AWS namespace, so adding aws-bedrock-agent-sink takes it from 31 to 32 and the catalog module's tests fail. Verified against the tree rather than just following the CI delta: 31 kamelets carry kamelet.namespace "AWS" on main, 32 with this branch. Only the AWS namespace is count-asserted, which is why the SMPP and SNMP Kamelets added in apache#2988, apache#2989 and apache#2990 did not trip it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
e1505fd to
d672b65
Compare
|
Pushed a fix for the red
Bumped the expectation to 32. Verified against the tree rather than just trusting the CI delta — 31 Kamelets carry Worth noting the AWS namespace is the only one with a count assertion, which is why the SMPP and SNMP Kamelets in #2988, #2989 and #2990 did not trip it. If a maintainer would rather this were a lower bound than a change detector, that is a reasonable separate cleanup — but changing the assertion's intent felt like scope creep inside a Kamelet PR, so I left the design alone and just updated the number. My own fault for not catching it before opening: I had run the root build with Also rebased onto current Claude Code on behalf of Andrea Cosentino |
Fixes #1938.
The issue asks for Bedrock Agent support. Two thirds of it already shipped — this closes the remaining gap.
aws-bedrockaws-bedrock-text-sinkaws-bedrock-agent-runtimeaws-bedrock-agent-runtime-sinkaws-bedrock-agentaws-bedrock-agent-sinkaws-bedrock-agentis the knowledge-base management component. Its three operations are all about data source ingestion jobs:A sink is the right and only shape — the component is producer-oriented, so the "and Source" half of the issue title has nothing to map onto. Say the word if you disagree and I will look again.
Properties
knowledgeBaseIdandregionare required;operationdefaults tostartIngestionJob.knowledgeBaseIddataSourceIdstartIngestionJoboperationstartIngestionJob(default) /listIngestionJobs/getIngestionJobregionaccessKey/secretKey/sessionTokenformat: password+ credentials descriptoraws-bedrock-agent-runtime-sinkThe header strip, and why it is not optional here
BedrockAgentProducer.determineOperationreads the header before the endpoint:and
knowledgeBaseId/dataSourceIdare header-overridable the same way. Without a strip, an inbound message could point a sink configured for one knowledge base at another, or turn astartIngestionJobinto something else — the exact pattern addressed foraws-ec2-sinkin #2978.CamelAwsBedrockAgentIngestionJobIdis excluded deliberately —getIngestionJobhas to name a job, so that one header is the Kamelet's intended message-level input rather than something it never asked for.Verification
script/validatorreports no errors,script/generatoradds thenav.adocentry,mvn clean installpasses from the repository root.Parameter binding against the real component with
camel run— the route starts with everything bound:The strip, checked by swapping the terminal endpoint for a log so the surviving headers are visible. Sending every overridable header plus an unrelated one:
The three dispatch-controlling headers are gone, the deliberate input survives, unrelated headers are untouched.
No Citrus test — this needs a real Bedrock knowledge base and there is no emulator for it in the project's Citrus/Testcontainers toolchain, so it ships
Previewwithoutkamelet.verified=true.Note
The catalog's
headersblock foraws-bedrock-agentlistsCamelAwsBedrockAgentRuntime*names, but the component's ownBedrockAgentConstantsusesCamelAwsBedrockAgent*(OPERATION = "CamelAwsBedrockAgentOperation"). I went with the constants, which is what the producer actually reads and what the probe above confirms. The catalog metadata looks like it has the runtime component's headers copied into it — worth a separate look upstream, but it does not affect this Kamelet.Claude Code on behalf of Andrea Cosentino