Spring Cloud Configuration Server not working with local properties file

后端 未结 9 2181
渐次进展
渐次进展 2020-12-05 07:43

I have been playing around with the Spring Cloud project on github located here: https://github.com/spring-cloud/spring-cloud-config

However I have been running into

9条回答
  •  死守一世寂寞
    2020-12-05 08:26

    I am able to read configuration for apple-service(Test Micro Service) using Spring config server.

    Example application.yml of spring config application

    spring:
        profiles:
            active: native
        cloud:
            config:
                server:
                    native:
                        searchLocations: classpath:config/
    server:
      port: 8888
    
    
    endpoints:
        restart:
          enabled: true
    

    Put your .properties or .yml files inside src\main\resources\config folder. Make sure name of this files should match spring.application.name of your micro service.

    For example if spring.application.name=apple-service then property file should be apple-service.properties in src\main\resources\config folder.

    Example bootstrap.yml of apple-service:

    spring:
      application:
        name: apple-service
    
    cloud:
      config:
        uri: http://localhost:8888
    

提交回复
热议问题