3

I need to create a dedicated config server for a list of microservices. Following is the snippet of application.yml of the config server:

server.port: 8888
management.security.enabled: false

spring:
  cloud:
    config:
      server:
        git:
          uri: some github link
          username: ENC(/YNsVqtbBwIOq+KlzzQrn6WZbg1tPxzn9V0BM=)
          password: ENC(+jatkfs906vfPwqPxtkgBn3LeVGr)
          search-paths:
            - microcervices1
            - microservices2
            - microservices3

jasypt:
  encryptor:
    algorithm: some algorithm
    password: Its password

I am facing problem in accessing those microservices configurations.

The documentation http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_spring_cloud_config_server mentions that wildcards {application}, {label}, {profile} can be used within the searchPaths variable so that "you can segregate the directories in the path"

It Would be a great help If anyone can help me out with this issue, Thanks!

Vipin Makde
  • 86
  • 1
  • 7
  • I think you made mistake in search paths. Its not 'search-path' its 'searchPaths' according to spring doucumentation. Reference : http://cloud.spring.io/spring-cloud-config/single/spring-cloud-config.html#_placeholders_in_git_search_paths – Abhijeet May 25 '18 at 06:29
  • Let me know what error you getting exactly. – Abhijeet May 25 '18 at 06:30

1 Answers1

6

It can be solved as following :

Suppose you have in your config repo properties for multimple services organized in folders: properties organized in folders

Then, your config file for config server looks like this :

server:
  port: 8888
spring:
  cloud:
    config:
      server:
        git:
          uri:[git repo]
          search-paths:
           - billing-service
           - shipping-service

This way you can organize all the properties in one central config repository and tell spring config server in which folders to look for properties

Ion Scorobogaci
  • 147
  • 2
  • 5