I have a spring config server and spring config client. In client I have set spring.cloud.config.uri to http://localhost:8888 but I want to change it to some other uri say http://example.com:8888 in windows using OS environment with setx. so I ran
setx spring.cloud.config.uri "http://example.com:8888"
but when I run my spring config client it's still trying to read from localhost . As per this link my spring.cloud.config.uri in bootstrap.yml should get override by what i set with OS environment but it didn't. Please let me know what I am doing wrong here.
setx
setxadds the variable but doesn't make it available in the current shell (as explained here):Just make sure you are runnning from a newly opened shell window.
I suggest you use
set spring.cloud.config.uri=http://example.com:8888just for the sake of testing.Check if the environment variable is present
You may add the following as the very first line your
mainmethod:Variable name with underscore
Windows supports environment variables with dots, so it should be ok for you. This isnt the case for pretty much all the other OS. Just so you know, spring supports variable name with underscores (as explained in the link you provided):