How to use with environment variables?
Paxa opened this issue · comments
Pavel Evstigneev commented
Any documentation on how it maps env variables to config values?
Artur Aukhatov commented
I'm also confused when try to use environment variables
Artur Aukhatov commented
Documentation don't have any information about it.
Artur Aukhatov commented
At first I exported env var:
export MY_SERVICE_URI=http://localhost:9900/
Then try to use it...
There is my code snippet:
ConfigurationSource envSource = new EnvironmentVariablesConfigurationSource();
ConfigurationProvider provider = new ConfigurationProviderBuilder()
.withConfigurationSource(envSource)
.build();
provider.getProperty("my.service.uri", String.class); // then throws exception...
Artur Aukhatov commented
Hi @Paxa!
I was debugging and found env vars resolving are case sensitive.
For the example above it means MY_SERVICE_URI
env will resolve as MY.SERVICE.URI
.
Pavel Evstigneev commented
THanks alot for explaining! Appreciate it
I was debugging and found env vars resolving are case sensitive.
I wish it was configurable