1

New to spring boot. Using config server to decentralize properties based on profile.

bootstrap.yml:

spring: application: name: nameoftheapp profiles: active: profilehere cloud: config: uri: https://someurlhere

application.properties: some other key value pairs goes here spring.application.name=nameofthedummyapp

console log:- XXX 2019-06-27 16:26:37.929 DEBUG [xxx,,,] 22564 --- [ main] o.s.web.client.RestTemplate : Created GET request for "https://someurlhere/nameofthedummyapp/profilehere" XXXX

But what I thought was, https://someurlhere/nameoftheapp/profilehere.

It seems, spring boot picked spring.application.name from the application.properties instead of bootstrap.yml. Commenting out in application.properties solved the issue.

What I have seen in examples are, for accessing the config server, spring boot is making use of bootstrap.yml. By mistake, I had conflicting names at both places.

But curious to know,

  1. whether spring boot is picking up from in approriate place? or
  2. Did the later loaded profile (application.properties) override the first loaded profile(bootstrap.yml)?

Little confused here.

Could someone share some insights here?

NANDAKUMAR THANGAVELU
  • 611
  • 3
  • 15
  • 34

1 Answers1

0

If you added config client dependencies in your project it will first fetch profiling and config server related properties from your bootstrap properties.

Yes your you are the issue is spring.application.name from bootstrap.properties was overridden by spring.application.name from application.properties file.

GnanaJeyam
  • 2,780
  • 16
  • 27