I am having trouble fetching the properties form a spring config server with another spring application.
I can fetch it with the browser so the config server itself seems to be fine, my client application however seems to just ignore my configuration where it should fetch the properties.
The Config server is straight forward:
@SpringBootApplication
@EnableConfigServer
public class ConfigserverApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigserverApplication.class, args);
}
}
and the application.properties
server.port=8888
spring.profiles.active=native
spring.cloud.config.server.native.searchLocations=${HOME}/FH/SKS/configserver/src/main/resources/configuration
management.security.enabled=false
I dont want to use any git for now so i just use a local file which is called
newsservice-config.properties:
message=Hello configuration server !
I can get the properties just fine with a browser:
.. so i guess its in my other configuration!
The Client
First of all i use an application.yml for general configuration which looks like this:
server:
port : 8081
spring:
jpa:
generate-ddl: true
hibernate:
ddl-auto: create
show-sql: true
databasePlatform: org.hibernate.dialect.MySQL5Dialect
not much in there regarding the config server. I have created a bootstrap.properties file besides the application.yml for the config server configuration:
spring.application.name=newsservice-config
spring.cloud.config.server.uri=http://localhost:8888
management.security.enabled=false
Name is correct.(name of the configuration file on the config server) Server adress is correct.
The REST Controller where i want to test everything:
@RefreshScope
@RestController
@RequestMapping("/article")
@CrossOrigin
public class ArticleController {
@Value("${message: Default Hello}")
private String message;
@GetMapping("/test")
public String tester(){
return this.message;
}
}
..however it doesnt fetch anything from the config server....
The resource structure of my client:
Any ideas what i am doing wrong ?
Kind regards...