davsclaus opened a new pull request, #27004: URL: https://github.com/apache/camel/pull/27004
Fixes [CAMEL-25101](https://issues.apache.org/jira/browse/CAMEL-25101). With `camel.main.autoConfigurationFailFast=false`, camel-main should log `Property not auto-configured: ...` for each `camel.*` property it could not apply, such as a typo in an option name. These warnings were never logged. ## Cause The property groups are `OrderedLocationProperties`. `BaseOrderedProperties` (camel-util) keeps its data in a private map, but did not override `forEach`, so `forEach` walked the empty `Hashtable` inherited from `java.util.Properties`. ## Changes - **camel-util:** `BaseOrderedProperties` now overrides the remaining map methods, built on the existing `get`/`put`/`remove`/`containsKey` so the subclasses keep working. The methods are `forEach`, `getOrDefault`, `putIfAbsent`, `remove(key, value)`, `replace`, `replaceAll`, `compute*`, `merge`, `elements` and `equals`/`hashCode`. - **camel-main:** with `forEach` working, some properties would have been reported even though nothing is wrong. They are now handled: - The `camel.variable.*` properties are cleared once the variables are set. - The options of a disabled service (lra, opentelemetry, opentelemetry2, mdc, telemetryDev, metrics) are dropped instead of reported. - The tracing services are chosen by whether they are enabled, not by whether any of their properties exist. Before, any `camel.opentelemetry.*` property (even with `enabled=false`) caused the `camel.opentelemetry2.*` and `camel.telemetryDev.*` properties to be ignored. - Warnings are added for `camel.metrics.*` and `camel.trace.*`. - The warning blocks share one helper, which masks the value of sensitive options (`xxxxxx`). The upgrade guide has an entry. ## Not changed - `camel.cluster.*` has no warning, because its properties are applied through per-type copies. - `clone()` still shares the map of the ordered properties. ## Tests - **New `MainNotAutoConfiguredWarningTest`** captures the WARN log: - A typo and an unknown secret option are reported, and the secret value is masked. - A normal configuration (variables, disabled lra and opentelemetry) reports nothing. - **`OrderedPropertiesTest`** is extended for the map methods. - **Without the fix:** both new tests fail. With only the camel-util part, the camel-main test fails on the four false warnings and on the unmasked secret. - **Full suites:** camel-main and all its upstream modules pass, built with `-am`. _Claude Code on behalf of Claus Ibsen_ 🤖 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
