[ 
https://issues.apache.org/jira/browse/CAMEL-23897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-23897:
--------------------------------
    Description: 
The PropertiesDevConsole (Configuration tab in camel-tui) is empty for Spring 
Boot and Quarkus apps because PropertiesComponent.loadProperties() only returns 
properties from Camel own sources (initialProperties, .properties files, 
overrideProperties). Application properties live in Spring Environment / 
SmallRye Config and are not enumerable through Camel PropertiesComponent.

For JBang/standalone Camel, all properties go through Camel PropertiesComponent 
so the dev console works fine.

h3. Constraints

*Cannot register a LoadablePropertiesSource wrapping the runtime environment:* 
DefaultPropertiesLookup iterates all sources for placeholder resolution, so it 
would conflict with SpringPropertiesParser / SmallRye and cause 
double-resolution or precedence issues.

*Cannot override the dev console:* DefaultDevConsoleRegistry.register() rejects 
duplicates (returns false if a console with the same ID exists).

*Unregister+register per runtime is messy:* Would need the same dance in both 
camel-spring-boot and camel-quarkus auto configuration.

h3. Recommended approach

Add an SPI in camel-api, e.g. PropertiesEnumerator, that runtimes can implement 
to contribute additional properties for display purposes only. 
PropertiesDevConsole would query all PropertiesEnumerator instances from the 
CamelContext registry alongside loadProperties(). Each runtime just registers 
one bean:

* camel-spring-boot: enumerates EnumerablePropertySource entries from 
ConfigurableEnvironment
* camel-quarkus: enumerates SmallRye Config properties

No console replacement or override needed. The SPI is read-only and does not 
affect placeholder resolution.

The console should show ALL application properties (not just camel.*), matching 
what the standalone Camel dev console already does.

  was:
The PropertiesDevConsole (Configuration tab in camel-tui) is empty for Spring 
Boot apps because PropertiesComponent.loadProperties() only returns properties 
from Camel own sources (initialProperties, .properties files, 
overrideProperties). Spring Boot application properties (server.port, custom 
app properties like greeting=hello, etc.) live in Spring Environment and are 
not enumerable through Camel PropertiesComponent.

For JBang/standalone Camel, all properties go through Camel PropertiesComponent 
so the dev console works fine. The gap is specific to Spring Boot (and possibly 
Quarkus).

h3. Constraints

*Cannot register a LoadablePropertiesSource wrapping Spring Environment:* 
DefaultPropertiesLookup iterates all sources for placeholder resolution, so it 
would conflict with SpringPropertiesParser and cause double-resolution or 
precedence issues.

*Cannot override the dev console:* DefaultDevConsoleRegistry.register() rejects 
duplicates (returns false if a console with the same ID exists). So 
camel-spring-boot cannot register a replacement PropertiesDevConsole.

h3. Possible approaches

1. Make PropertiesComponent.loadProperties() in camel-spring-boot also 
enumerate Spring Environment properties (add a read-only 
LoadablePropertiesSource that only participates in loadProperties but NOT in 
getProperty resolution). This may require a new interface or flag to 
distinguish enumeration-only sources from resolution sources.

2. Add an SPI (e.g. PropertiesEnumerator) that runtimes can implement to 
provide additional properties for display. PropertiesDevConsole would query 
this SPI alongside loadProperties().

3. Make PropertiesDevConsole extensible (protected method to contribute 
additional properties) so Spring Boot can subclass it - but this conflicts with 
the @DevConsole annotation and duplicate rejection.

The console should show ALL application properties (not just camel.*), matching 
what the standalone Camel dev console already does.

        Summary: PropertiesDevConsole should show application properties from 
all runtimes (Spring Boot, Quarkus)  (was: PropertiesDevConsole should show 
Spring Boot application properties)

> PropertiesDevConsole should show application properties from all runtimes 
> (Spring Boot, Quarkus)
> ------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-23897
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23897
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-spring-boot
>            Reporter: Claus Ibsen
>            Priority: Major
>
> The PropertiesDevConsole (Configuration tab in camel-tui) is empty for Spring 
> Boot and Quarkus apps because PropertiesComponent.loadProperties() only 
> returns properties from Camel own sources (initialProperties, .properties 
> files, overrideProperties). Application properties live in Spring Environment 
> / SmallRye Config and are not enumerable through Camel PropertiesComponent.
> For JBang/standalone Camel, all properties go through Camel 
> PropertiesComponent so the dev console works fine.
> h3. Constraints
> *Cannot register a LoadablePropertiesSource wrapping the runtime 
> environment:* DefaultPropertiesLookup iterates all sources for placeholder 
> resolution, so it would conflict with SpringPropertiesParser / SmallRye and 
> cause double-resolution or precedence issues.
> *Cannot override the dev console:* DefaultDevConsoleRegistry.register() 
> rejects duplicates (returns false if a console with the same ID exists).
> *Unregister+register per runtime is messy:* Would need the same dance in both 
> camel-spring-boot and camel-quarkus auto configuration.
> h3. Recommended approach
> Add an SPI in camel-api, e.g. PropertiesEnumerator, that runtimes can 
> implement to contribute additional properties for display purposes only. 
> PropertiesDevConsole would query all PropertiesEnumerator instances from the 
> CamelContext registry alongside loadProperties(). Each runtime just registers 
> one bean:
> * camel-spring-boot: enumerates EnumerablePropertySource entries from 
> ConfigurableEnvironment
> * camel-quarkus: enumerates SmallRye Config properties
> No console replacement or override needed. The SPI is read-only and does not 
> affect placeholder resolution.
> The console should show ALL application properties (not just camel.*), 
> matching what the standalone Camel dev console already does.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to