I have a spring boot application and I would like to get properties that I have on a consul agent.
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages={"com.commons"})
public class MainAppProxy implements CommandLineRunner {
@Value("${proxy.endpoint}")
private String endpointAddress;
My application.properties is under src/main/resources
spring.application.name=SOAPProxy
spring.cloud.consul.host=http://10.0.1.241
spring.cloud.consul.port=8500
spring.cloud.config.discovery.enabled=false
in pom.xml I have the following config (short version)
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.SR5</version>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
The properties are stored on consul in this format: Business/SOAPProxy/proxy.endpoint
When the application boots, it seems that it finds consul but it cannot get the values as it could before trying consul @Value("${proxy.endpoint}") How can I get the properties on consul?