Closed fmartinou closed 3 years ago
Hi,
Any news on this?
I found a workaround to achieve what I want (make Spring Cloud Consul get the configuration from my-product/my-env/my-module/my-app/2.0.0
)
I removed the context from SPRING_CONFIG_IMPORT
and I defined a custom prefix and a custom appname.
Example:
SPRING_CONFIG_IMPORT=consul:
SPRING_CLOUD_CONSUL_CONFIG_PREFIX=my-product/my-env
SPRING_CLOUD_CONSUL_CONFIG_NAME=my-module/my-app/2.0.0
It's a little dirty because Spring Cloud Consul will also watch for keys under my-product/my-env/application
😞 .
Closed via #744
Hi,
Every microservice we run can access its configuration on Consul under a folder conventioned as
$product/$environment/$module/$app/$version
Example:
my-product/my-env/my-module/my-app/2.0.0
To configure our Spring Boot apps, we set on them an env var:
SPRING_CONFIG_IMPORT=consul:/my-product/my-env/my-module/my-app/0.0.0
Unfortunately our configuration is never overridden with values from Consul because of a bug in ConsulPropertySource
Previously (Spring Boot
2.4.5
) we used a workaround by defining a;
in the String:SPRING_CONFIG_IMPORT=consul:localhost:8500;my-product/my-env/my-module/my-app/0.0.0
But is does not work anymore on greater versions of Spring Boot/Spring Cloud . We now get a
java.lang.NumberFormatException: For input string: "8500;"
Is that something that can be directly fixed in Spring Cloud Consul or is there an other solution to get it working?