I have created the Config server with DB as backup and able to bring up successfully. even i can verify the properties by hitting the url http://localhost:8080/myapp/myenv/mylabel but when i try to bind this config server to a client app, its showing that tits binded, but now showing any label as part of the loading. o.s.b.c.config.ConfigDataLoader - Located environment: name=consumer-svc, profiles=[dev], label=null, version=null, state=null.
not sure how to provide the label here in the client app.
Any help would be greatly appreciated.
Comment From: ryanjbaxter
What version of spring cloud are you using?
Comment From: cmalli
I think it’s 3.1.4
On Sat, Feb 18, 2023 at 7:47 PM Ryan Baxter @.***> wrote:
What version of spring cloud are you using?
— Reply to this email directly, view it on GitHub https://github.com/spring-cloud/spring-cloud-config/issues/2232#issuecomment-1435812387, or unsubscribe https://github.com/notifications/unsubscribe-auth/A57TFD57MHES4VBFQNLWKGTWYF3S3ANCNFSM6AAAAAAVAVKDMY . You are receiving this because you authored the thread.Message ID: @.***>
Comment From: ryanjbaxter
Can you please verify and provide a sample to reproduce the issue?
Comment From: cmalli
I just have the sample table with the required fileds and i am able to bring up the config server. even i hit the local host with the sample values, i could see the response.
Below is the dependency
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
<version>3.1.4</version>
</dependency>
URL: http://localhost:8888/consumer-svc/dev/1.0 Response: {"name":"consumer-svc","profiles":["dev"],"label":"1.0","version":null,"state":null,"propertySources":[{"name":"consumer-svc-dev","source":{"prop1":"Test prop from dev","prop2":"Test prop2 from dev environment","prop3":"Test prop3 from dev environment"}}]} Then i created a sample springboot app and configured to this server to read the properties. below is the configuration. spring: application: name: consumer-svc config: import: "configserver:http://localhost:8888" output: ansi: enabled: ALWAYS profiles: active: dev and when i see the client app logs while starting, label is showing as null [19-02-2023 21:50:58.941] [main] [INFO ] net.jpmchase.gbp.config.Application - Starting Application using Java 11.0.18 on chcd196c1n1 with PID 17984 (I:\ds\projects\temp\cfg-server-client\target\classes started by R712594 in I:\ds\projects\temp\cfg-server-client) [19-02-2023 21:50:58.943] [main] [INFO ] net.jpmchase.gbp.config.Application - The following 1 profile is active: "dev" [19-02-2023 21:50:58.972] [main] [INFO ] o.s.b.c.config.ConfigDataLoader - Fetching config from server at : http://localhost:8888 [19-02-2023 21:50:58.972] [main] [INFO ] o.s.b.c.config.ConfigDataLoader - Located environment: name=consumer-svc, profiles=[dev], label=null, version=null, state=null
Comment From: cmalli
I was able to read the properties based on the label. the property i need to add in order to enforce the label is below.
spring.cloud.config.label=1.0
Once i add that property, see its loading
[19-02-2023 22:37:08.439] [main] [INFO ] net.jpmchase.gbp.config.Application - The following 1 profile is active: "dev" [19-02-2023 22:37:08.464] [main] [INFO ] o.s.b.c.config.ConfigDataLoader - Fetching config from server at : http://localhost:8888/ [19-02-2023 22:37:08.464] [main] [INFO ] o.s.b.c.config.ConfigDataLoader - Located environment: name=consumer-svc, profiles=[dev], label=1.0, version=null, state=null