[ 
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 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.

  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).

*Important:* Registering a LoadablePropertiesSource wrapping Spring Environment 
would make it participate in placeholder resolution (DefaultPropertiesLookup 
iterates all sources), which could conflict with SpringPropertiesParser and 
cause double-resolution or precedence issues.

Safer approach: Override PropertiesDevConsole in camel-spring-boot to read from 
Spring ConfigurableEnvironment (enumerate all EnumerablePropertySource 
entries). This is read-only and does not affect the resolution pipeline.

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


> PropertiesDevConsole should show Spring Boot application properties
> -------------------------------------------------------------------
>
>                 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 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.



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

Reply via email to