Hey guys looking for some guidance with spring cloud config with respect to different profiles and spring boot versions. Am currently bumping up spring boot version from 2.5.1 to 2.5.12. Am using spring cloud config version of 3.0.6.

On spring boot 2.5.1, since profile specific resolution was not allowed, previously used config client using import through multi document file. In spring boot, 2.5.2, profile specific resolution came back and so now in spring boot 2.5.12, I am using profile specific resolution.

But I needed to add all spring cloud properties in the same profile specific properties file or default properties (application.properties). Is this expected behavior? Am wondering what/why behavior changed from 2.5.2 to 2.5.12. Am wondering if this is the approach you would take?

This may seem unnecessarily complicated but I am trying to simplify a complex configuration to a workable example.

Thanks for any help

I put together an example repo: https://github.com/speedo72/configserver-behavior

The example can be summed up below. Just wondering why behavior changed from spring boot version 2.5.2 to 2.5.12 and whether that's expected.

Spring boot version 2.5.2 (not valid in 2.5.12 – ConfigClientProperties not picking up spring cloud config properties)

Application.properties spring.profiles.active=common spring.profiles.include=dev,config

Application-dev.properties spring.application.name=secret spring.cloud.config.enabled=true spring.cloud.config.username=user spring.cloud.config.password=password spring.cloud.config.fail-fast=true

Application-config.properties spring.config.import=configserver:http://localhost:8888 spring.cloud.config.token=myroot

Spring boot version 2.5.12

Application.properties spring.profiles.active=common spring.profiles.include=dev,config

Application-config.properties spring.application.name=secret spring.cloud.config.enabled=true spring.cloud.config.username=user spring.cloud.config.password=password spring.cloud.config.fail-fast=true spring.config.import=configserver:http://localhost:8888 spring.cloud.config.token=myroot

Again thanks for any help.

Comment From: ryanjbaxter

Just so I understand the only thing you are changing is the Boot version and not the Spring Cloud version?

Comment From: marcpintoo

Yes exactly just changing spring boot version. Spring cloud config version is consistent at 3.0.6.

Comment From: ryanjbaxter

Can you try Spring Cloud 2021.0.1?

Comment From: marcpintoo

Thanks so much for the response

Yes I can confirm the same behavior is happening with 2021.0.1

The reason for this post was I noticed that in order to use spring.config.import:configserver in a profile specific properties file (application-config.properties) activated by spring.profiles.include/group, the "spring.cloud.config" properties must be declared in either the default profile(regular application.properties), profile declared by spring.profiles.active, or in the same properties file as the spring.config.import declaration only for the newer versions of spring boot. (If spring.cloud.config properties are defined in spring.profiles.include/group they are not picked up by config profile).

Really I was just trying to make sure I'm not crazy and if this make sense and if it does make sense am wondering why?

Comment From: ryanjbaxter

I know there were some changes within minor release of Spring Boot, maybe one of those changes caused the difference. Can you put together a sample with the above configuration so we can take a look?

Comment From: marcpintoo

Hey Ryan thanks for your reply. I've created repo: https://github.com/speedo72/configserver-behavior.

The folders behavior/client-2.5.2-case2 and behavior/client-2.6.6-case2 display the difference in behavior. For some reason 2.6.6 is not picking up ConfigClientProperties. This has to do with how I declare profiles in application.properties.

Please let me know if this sample is unclear. Thanks again for your help

Comment From: ryanjbaxter

Can you please retry this with Spring Cloud 2021.0.x and Boot 2.7.x or 2022.0.x and Boot 3.0.x?

Comment From: spring-cloud-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.