0

I am creating a basic client/server configured app in Spring Boot, but when I start my client app, I have this:

...  INFO [bootstrap,,,] ... Fetching config from server at: http://myConfig.com:8080
...  INFO [bootstrap,,,] ... ConfigServicePropertySourceLocator : Located environment: name=application, profiles=[default], label=master, version=..., state=null

EDIT: The problem is that I configured my app name with my-app, so I was expecting name=my-app instead of name=application. So the client is not getting the expected configuration.

EDIT2: The config server is running in an exclusive VM, so the 8080 port is available (just for the config server). There is nothing else running in my config server.

I read some posts, and I could mark the following items:

1) I have

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>

in my pom.xml file

2) My bootstrap.properties, located in my-app\src\main\resources has the following content:

spring.application.name=my-app
server.port=8080
spring.cloud.config.uri=http://myConfig.com:8080

3) When I access http://myConfig.com:8080/my-app/default/master with my browser, I get the corresponding configuration, so the server is working properly.

4) My config server had an application.properties in the past, but not now (I thought that it was the problem -a default property file-, but I refreshed and the problem is still there)

5) The problem appears the first time I run my app, I guess is not related to a health check.

Do you have any ideas about why the app is trying to say "name=application" instead of the real name? What I missed in my setup? Thanks in advance!

EDIT3: More data: My config server is returning this:

{"name":"my-app","profiles":["default"],"label":"master","version":"...","state":null,"propertySources":[{"name":"file://myPath/my-app.properties","source":{"spring.rabbitmq.username":"MYUSER","spring.datasource.url":"jdbc:postgresql://someData?ssl=true","spring.datasource.username":"MyUser","spring.jpa.hibernate.ddl-auto":"update","security.user.name":"MyUser2","spring.datasource.driverClassName":"org.postgresql.Driver", AND OTHER SPECIFIC DATA...}}]}
MarcosTonina
  • 351
  • 1
  • 3
  • 16

0 Answers0