You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/06/26 09:51:07 UTC
[PR] CAMEL-23462: camel-aws-bedrock - reject wrong-type body in invoke*Model POJO mode with a clear error [camel]
oscerd opened a new pull request, #24269:
URL: https://github.com/apache/camel/pull/24269
## What this PR does
Fixes [CAMEL-23462](https://issues.apache.org/jira/browse/CAMEL-23462).
The `invokeTextModel`, `invokeImageModel`, and `invokeEmbeddingsModel` operations in `BedrockProducer` only acted when `pojoRequest=true` **and** the message body was an `InvokeModelRequest`. For any other body type (e.g. `String`, `Map`), the `if (payload instanceof InvokeModelRequest ...)` block was skipped with no `else`, so the producer returned silently — leaving the caller with a `null` body and no indication of what went wrong.
The `converse`, `converseStream`, and `applyGuardrail` operations already throw an `IllegalArgumentException` for the same misconfiguration. This PR makes the invoke operations consistent.
## Changes
- **`BedrockProducer`**: add an `else throw new IllegalArgumentException(...)` branch to:
- `invokeTextModel`
- `invokeImageModel`
- `invokeEmbeddingsModel`
- `invokeTextModelStreaming` — the same silent no-op existed on the streaming path; this also covers `invokeImageModelStreaming` and `invokeEmbeddingsModelStreaming`, which delegate to it.
- **New `BedrockInvokeModelPojoRequestTest`**: 5 mock-based unit tests (no AWS credentials / network) verifying each operation fails fast with the expected `IllegalArgumentException` type and message when given a wrong-type POJO body. The exception is raised before any client call, so a mocked client suffices.
## Behaviour change
| | Before | After |
|---|--------|-------|
| Wrong-type body, `pojoRequest=true` | silent `null` output, no error | `IllegalArgumentException` naming the required body type |
This only affects already-broken/misconfigured routes (a wrong body type produced no usable output before). No default, option, header, or public API signature changes, so no upgrade-guide entry is required.
## Testing
`mvn clean install -Psourcecheck` in `components/camel-aws/camel-aws-bedrock` → **BUILD SUCCESS**, 122 tests pass (including the 5 new ones), formatter/impsort clean.
---
_Claude Code on behalf of Andrea Cosentino._
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23462: camel-aws-bedrock - reject wrong-type body in invoke*Model POJO mode with a clear error [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24269:
URL: https://github.com/apache/camel/pull/24269#issuecomment-4808732765
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23462: camel-aws-bedrock - reject wrong-type body in invoke*Model POJO mode with a clear error [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #24269:
URL: https://github.com/apache/camel/pull/24269
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23462: camel-aws-bedrock - reject wrong-type body in invoke*Model POJO mode with a clear error [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24269:
URL: https://github.com/apache/camel/pull/24269#issuecomment-4808815801
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `components/camel-aws/camel-aws-bedrock`
<details><summary>All tested modules (8 modules)</summary>
- Camel :: AWS2 Bedrock
- Camel :: JBang :: MCP
- Camel :: JBang :: Plugin :: Route Parser
- Camel :: JBang :: Plugin :: TUI
- Camel :: JBang :: Plugin :: Validate
- Camel :: Launcher :: Container
- Camel :: YAML DSL :: Validator
- Camel :: YAML DSL :: Validator Maven Plugin
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/28230622516)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org