Settings in application.yml for spring.cloud.config are not used when the application is running

I have a problem with spring cloud: my settings in application.yml for spring.cloud.config are not used when the application is running. let me dwell here in detail. I would like my services to be able to receive settings from a remote ConfigServer. I created ConfigServer as a spring boot application with @EnableConfigServer annotation. After that, I created a client application with the following configuration file:

    application:
      name: mw
    cloud:
      config:
        enabled: true
        uri: http://172.17.42.1:8888
        fail-fast: true

main class:

    @EnableEurekaClient
    @SpringBootApplication
    public class MwApplication

and additional configuration in the application:

    @Configuration
    @EnableJpaRepositories(basePackages = {"com.sample.repository"})
    @EnableTransactionManagement
    @EnableScheduling
    public class AppConfiguration

I also have the following dependencies:

    spring-cloud-starter-eureka
    spring-cloud-config-client
    spring-boot-configuration-processor
    spring-boot-starter-data-jpa

, : ConfigServicePropertySourceLocator: PropertySource: - GET http://localhost:8888/mw/default "

uri (localhost), uri . org.springframework.cloud.config.client.ConfigServiceBootstrapConfiguration ConfigClientProperties , application.yml .

? .

+4
1

application.yml:

spring:
    cloud:
        config:
            enabled: true

bootstrap.yml application.yml. , spring. SO, Michael Isvy, , : application.yml bootstrap.yml spring boot?

Spring Cloud , , .

bootstrap.yml application.yml.

:

  • spring Cloud Config Server spring.application.name spring.cloud.config.server.git.uri bootstrap.yml
  • encryption/decryption

, bootstrap.yml spring ApplicationContext. ApplicationContext , application.yml.

+3

All Articles