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/16 12:35:42 UTC
[PR] CAMEL-23772: dataformat component honors global camel.dataformat.* configuration [camel]
oscerd opened a new pull request, #24050:
URL: https://github.com/apache/camel/pull/24050
## Summary
`dataformat:` component endpoints (e.g. `to("dataformat:beanio:unmarshal")`) ignored the global `camel.dataformat.<name>.*` configuration from `application.properties`, while the equivalent fluent DSL (`unmarshal().beanio(...)`) already honored it. The two paths behaved inconsistently, and the component path could throw at runtime (e.g. `IllegalArgumentException: Stream name not configured` for BeanIO).
Reported while analysing [camel-quarkus#7651](https://github.com/apache/camel-quarkus/issues/7651); the root cause is in Camel core.
## Root cause
`DataFormatComponent.createEndpoint()` calls `createDataFormat(name)`, which returns a fresh, **unconfigured** instance, and then binds only the endpoint URI parameters. It never copies the options of the auto-configured "template" data format (the one set up from `camel.dataformat.<name>.*`, resolvable via `resolveDataFormat(name)` and listed in `getDataFormatNames()`).
`DataFormatReifier.configureDataFormat()` already does this for the `marshal()`/`unmarshal()` DSL path (CAMEL-22352), but the component uses a different code path that was never updated.
## Fix
When the component creates a brand-new data format instance, it now harvests the auto-configured template's option values (via the same `ExtendedPropertyConfigurerGetter` mechanism the reifier uses) and binds them onto the new instance **before** binding the endpoint URI parameters — so URI parameters keep precedence over the global configuration. The shared template instance itself is never mutated.
The change is intentionally contained to `camel-dataformat`. `AbstractCamelContext.createDataFormat()` is deliberately left unchanged, since it must keep returning a clean instance for the reifier and other callers.
## Tests
Added `DataFormatComponentConfigTest` in `camel-csv` (mirroring the CAMEL-22352 `MainCsvTest`): a `Main`-based route using `to("dataformat:csv:unmarshal")` with `camel.dataformat.csv.ignore-surrounding-spaces=true` in `application.properties`. It asserts the global option is applied (surrounding spaces stripped) — this fails without the fix and passes with it. The existing `MainCsvTest` (reifier path) still passes.
## Docs
Added a `camel-dataformat` entry to the 4.21 upgrade guide describing the behavior alignment.
## Build
Full-reactor `mvn clean install -Dquickly` passes. No generated/catalog/DSL files changed (there is no `@UriParam` surface change).
---
_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-23772: dataformat component honors global camel.dataformat.* configuration [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #24050:
URL: https://github.com/apache/camel/pull/24050
--
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-23772: dataformat component honors global camel.dataformat.* configuration [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24050:
URL: https://github.com/apache/camel/pull/24050#issuecomment-4721273168
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `components/camel-csv`
- `components/camel-dataformat`
- `docs`
> :information_source: Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the `test-dependents` label to force testing all dependents.
:white_check_mark: **POM dependency changes: targeted tests included**
<details><summary>Modules affected by dependency changes (3)</summary>
- `:camel-csv`
- `:camel-dataformat`
- `:docs`
</details>
<details><summary>Build reactor — dependencies compiled but only changed modules were tested (3 modules)</summary>
- Camel :: CSV
- Camel :: Dataformat
- Camel :: Docs
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/27632388539)
--
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-23772: dataformat component honors global camel.dataformat.* configuration [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24050:
URL: https://github.com/apache/camel/pull/24050#issuecomment-4718796028
: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