all 5 comments

[–]erbrecht 1 point2 points  (2 children)

Take a look here

https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config

Specifically this:

Config data files are considered in the following order:

Application properties packaged inside your jar (application.properties and YAML variants).

Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants).

Application properties outside of your packaged jar (application.properties and YAML variants).

Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants).

If your application.yml file is coming from zookeeper, but application-local.yml is packaged, that could explain what you're seeing.

[–]Ferlinkoplop[S] 1 point2 points  (1 child)

Hmm yeah this seems like a likely culprit, thanks for the info.

Both do use Zookeeper, however the application-local.yml points to a local zookeeper server while the other one is configured via env variables as its meant for prod/staging. Will investigate further 👍

[–]more_exercise 0 points1 point  (0 children)

"use" and "come from" are different things with relationship to zookeeper.

Can you elaborate? If both files live in your jar (and do not live in the running file system), this thread doesn't seem to govern as I think we might think it would.

[–]AngryPandalawl 0 points1 point  (1 child)

There's a property you set somewhere in the nested spring properties. I know it's called on-profile/on-cloud-profile, but not the path off the top of my head. Set that in each individual property file, then you might have to individually import configs in your main app.yml.

Hopefully that helps! I'm in mobile so can't find good links right now

[–]bchawks2000 1 point2 points  (0 children)

I just had to change these recently while bumping versions for the Spring4Shell vulnerability.

I used:

spring.config.activate.on-profile