spring-cloud-consul icon indicating copy to clipboard operation
spring-cloud-consul copied to clipboard

Multiple property sources?

Open amrishdhoot opened this issue 8 years ago • 7 comments

I am trying to use Consul to get Kev/Value pairs during the bootstrap process of my application. The folder structure on Consul looks like: public/service-name private/service-name Note that there is no config folder anywhere over here.

I can manage to get my resources as : config/public/service-name and config/private/service-name But that's not what I want.

I want the prefix to be empty. It is a nonEmpty value today. I can't override it to empty string and if I don't set it, it defaults to "config". I am overriding defaultContext from "applications" to "public/service-name" but it prepends the prefix to it and ends up as config/public/service-name.

Is there any way to work around this problem?

My bootstrap looks like this and am trying to find workarounds to call private/service-name and public/service-name at bootstrap time.

spring:
    cloud:
        consul:
           enabled: true
           host: http://127.0.0.1    
           port: 8500
           config:
                prefix: ""
                name: private/service-name
                acl-token: xxx
                defaultContext: public/service-name

Thanks Amrish

amrishdhoot avatar May 21 '17 18:05 amrishdhoot

Please learn how to properly format code and logs.

spencergibb avatar May 22 '17 14:05 spencergibb

Sure. Will do. Thanks for looking into this. So there is no workaround for specifying multiple source folders for consul today in spring-cloud-consul. Correct?

amrishdhoot avatar May 22 '17 14:05 amrishdhoot

Not currently

spencergibb avatar May 22 '17 15:05 spencergibb

duplicate of #303?

spencergibb avatar May 22 '17 18:05 spencergibb

Would you mind if I submit a pull request for this?

Thanks, Amrish

amrishdhoot avatar May 22 '17 22:05 amrishdhoot

Anything new here? For example prefix is config, application name is testApp I want to get configurations from multiple folders, something like searchPaths which config server support:

config/common/application.yml config/security/application-cloud.yml config/apps/testApp.yml Is it possible?

bebers22 avatar Feb 28 '21 17:02 bebers22

Nothing new. PRs welcome

spencergibb avatar Feb 28 '21 17:02 spencergibb