You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Federico Mariani (Jira)" <ji...@apache.org> on 2026/07/12 12:14:00 UTC

[jira] [Commented] (CAMEL-24025) camel-observability-services-starter: ship defaults via EnvironmentPostProcessor instead of config/application.properties so users can override them

    [ https://issues.apache.org/jira/browse/CAMEL-24025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095694#comment-18095694 ] 

Federico Mariani commented on CAMEL-24025:
------------------------------------------

PR opened: https://github.com/apache/camel-spring-boot/pull/1847

The packaged config/application.properties is replaced by an EnvironmentPostProcessor registering the same defaults as the lowest precedence property source, so user configuration overrides them following standard Spring Boot precedence rules. A follow-up docs PR in apache/camel will remove the obsolete customization WARNING from observability-services.adoc.

_Claude Code on behalf of Federico Mariani_

> camel-observability-services-starter: ship defaults via EnvironmentPostProcessor instead of config/application.properties so users can override them
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24025
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24025
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-spring-boot-starters
>            Reporter: Federico Mariani
>            Assignee: Federico Mariani
>            Priority: Major
>             Fix For: 4.22.0
>
>
> {{camel-observability-services-starter}} packages its opinionated defaults as a literal {{config/application.properties}} inside the starter jar:
> https://github.com/apache/camel-spring-boot/blob/main/components-starter/camel-observability-services-starter/src/main/resources/config/application.properties
> Spring Boot's config-data search order is {{classpath:/}} first, then {{classpath:/config/}}, with later locations winning. So the starter's file silently overrides the same keys in the application's own {{application.properties}} — users can only beat it with higher-precedence sources (env vars, system properties, external config files). This is the root cause of the documented limitation "the customization of the configuration for this component is not available for Spring Boot runtime". It also means the starter force-overrides {{management.server.port=9876}} even when the user sets it, unlike the Camel Main and Quarkus variants where defaults are user-overridable. Spring Boot's reference docs on custom starters explicitly advise against packaging an {{application.properties}}/{{yml}} in a library for exactly these reasons (plus classpath-order nondeterminism if two jars ship the same resource path).
> *Proposal:* replace the packaged {{config/application.properties}} with an {{EnvironmentPostProcessor}} (registered in {{META-INF/spring.factories}}) that adds the same keys as a {{MapPropertySource}} via {{environment.getPropertySources().addLast(...)}}. Being last, the defaults keep working out of the box but every key becomes overridable through normal Spring Boot precedence (application properties, profiles, env vars). The documented customization limitation can then be removed, aligning the Spring Boot behavior with Camel Main and Quarkus.



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