Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

loading multiple properties with config-server

I have successfully tested loading properties from SVN repository, currently in my config server i have provided the URI and default-label: trunk and i have application specific property under trunk. below is the contents of my consuming application's application.yml and able to pull the properties successfully

spring:
  application:
    name: foo-development
  cloud:
    config:
      uri: http://localhost:${config.port:8888}

now i have a shared property in different folder thats shared across other applications as well, so how do i load this into my application along with my application specific

like image 444
GG0424 Avatar asked Sep 05 '25 03:09

GG0424


1 Answers

The spring.cloud.config.name property allows you to specify multiple application names separated by a comma, so all you have to do is change your application.yml to

spring:
  application:
    name: foo-development
  cloud:
    config:
      uri: http://localhost:${config.port:8888}
      name: foo-development,myshared

This will load both foo-development properties as well as myshared properties.

like image 189
THelper Avatar answered Sep 07 '25 20:09

THelper