spring-cloud-consul
spring-cloud-consul copied to clipboard
Support search locations similar to spring cloud config
how to configurate multiple config names so that I'm abled to use multiple keys from consul config to start my project? like this: spring.cloud.consul.config.name=mysql,rabbitmq,zipkin,${spring.application.name} then, I can read multiple key's value to configurate my project?
Official introduction is config/testApp,dev/ config/testApp/ config/application,dev/ config/application/
Does that configuration not work?
I also came across with the same scenario where i need to load configs from different files which have different path and different names.
/app/global/global.yml /app/app1/common.yml /app/app1/tech.yml /app/app1/product.yml
@spencergibb is there any way to achieve this?
@Nishant-sehgal did you try?
spring.cloud.consul.config.name=mysql,rabbitmq,zipkin,${spring.application.name}
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
let me check for the same. Will revert Back.
@Nishant-sehgal did you try?
spring.cloud.consul.config.name=mysql,rabbitmq,zipkin,${spring.application.name}
@spring-issuemaster yes i tried with the below changes. spring.cloud.consul.config.name=a1,a2,a3,a4 using the above config it is referring to below consul directory.
ConsulPropertySource {name='APP/config/a1,a2,a3,a4/'}. Which is not correct. morever if that works still file names are different in each folder how to provide multiple file names in the config.
if my directory structure is this: /app/app1/props.yml
config used: in this case all my properties are in single file and this file is quite huge.
spring: cloud: consul: host: consul.mmt.mmt port: 8500 config: enabled: true data-key: props.yml format: yaml prefix: app/app1
new directory structure:
/app/global/global.yml /app/app1/common.yml /app/app1/tech.yml
i want to read all these 3 files common.yml,tech.yml,global.yml in my application.How to do that?
We don't support subdirectories. You may be able to get something similar based on spring.profiles.active but it won't be in separate directories.
so if it is supported then i need to do something like.
searchPaths: app/app1/,app/global/
and it can still have different file names in subdirectories?
while reading we have to provide data-key so that should not be used?
You would be able to use substitutions like {application} instead of hard coded app names.
what would be the data-key to be provided as we need to provide the same while dealing with yaml files.Since file names would be different in this case. Or it is not required it will auto scan all the files with the directory provided.