1

I have a spring cloud project. There are config server (config-srv), eureka server (eureka-srv) and some other service with business logic, let's call it main service (main-srv).

I'm packaging them into jars and run one by one. My apps get their properties from a file in the same directory with jars.

So, I'm setting properties to config-srv through "application-native.properties".

But if i want to change config-srv url (for example, i want http://localhost:9999), how can i share this url for all micro-services before they will boot ? I'm trying to share this url in "application-default.properties" but it makes no effect.

Gimhani
  • 1,318
  • 13
  • 23

1 Answers1

1

You can put the Spring Cloud Config server details in bootstrap.properties file in each microservices.

spring.application.name=microserviceName
spring.profiles.active=dev
spring.cloud.config.uri=http://localhost:9999
spring.cloud.config.username=your_username
spring.cloud.config.password=your_password

Go through the link to have more detail about spring cloud config https://howtodoinjava.com/spring-cloud/spring-cloud-config-server-git/

Gaurav Srivastav
  • 2,381
  • 1
  • 15
  • 18
  • well, all properties must be input from outside - this is a business rule. im setting all required properties in config-srv when it boot and overriding them in config-server context. that is making config-srv environment variables become visible for all clients. – Danil Gordeev Sep 19 '18 at 19:08