micronaut-discovery-client icon indicating copy to clipboard operation
micronaut-discovery-client copied to clipboard

Add flag for use name as prefix

Open tibistibi opened this issue 1 year ago • 2 comments

Feature description

To use consul I have this config:

micronaut:
  application:
    name: myProject
  config-client:
    enabled: true

This will collect all key values from Consul which are in application and in myProject directory. This is cool.

But it also will collect all keys from myProject2. Which we do not want. I can imagine that this can be a handy feature. That I can have generic keys which will merge into other projects. But we have over 50 projects and we run into names which happen to start the same.

What we do now to work around this is adding a / at the end of the name. Which is a problem as profiles will not work any more. Than it will look for myProject/,profile1 instead of myProject,profile

So a solution could be that there is an option like this

micronaut:
  application:
    name: myProject
  config-client:
    enabled: true
    use-name-as-prefix: false

Which will not use the name as a prefix but only exact matches are allowed

tibistibi avatar Jan 27 '23 14:01 tibistibi