Eureka default zone setting is not picked up when using environment variables
See original GitHub issuespringBootVersion = ‘2.0.0.M7’ springCloudVersion = ‘Finchley.M5’
docker-compose setup (stripped down):
mongo:
ports:
- 27017:27017
eureka:
ports:
- 8761:8761
test-client:
ports:
- 8080:8080
environment:
SPRING_DATA_MONGODB_HOST: "mongo"
EUREKA_INSTANCE_PREFER_IP_ADDRESS: "true"
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: "http://eureka:8761/eureka/"
The EUREKA_CLIENT_SERVICEURL_DEFAULTZONE
environment variable is not picked up.
Others, like the mongo host work ok.
Moving the setting inside the test-client application.properties works: eureka.client.service-url.defaultZone=http://eureka:8761/eureka/
I think it might be something caused by the naming of defaultZone
(the service-url
binds to a Map<String,String> and I don’t think the rezolver handles correctly the camelCase in defaultZone)
Probably related to https://github.com/spring-projects/spring-boot/issues/8902
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Configuring Spring Eureka Client through environmental ...
I have tried a few variable names: eureka.instance.hostname. EUREKA_CLIENT_SERVICEURL_DEFAULTZONE. eureka.client.serviceUrl.defaultZone. I also ...
Read more >2. Service Discovery: Eureka Server - Spring Cloud
This section describes how to set up a Eureka server. ... page for details on setting up your build system with the current...
Read more >Spring Cloud discussion and questions - Gitter
Question for the masses about registering an app with Eureka on startup -- if I have eureka.client.service-url.defaultZone set in my application.properties ...
Read more >eureka-js-client - npm Package Health Analysis - Snyk
A JavaScript implementation the Netflix OSS service registry, Eureka. For more information about how to use this package see README.
Read more >RE: Added RunConfigurations as Project Files for IntelliJ-Apache ...
The environment variables here are only needed for development purposes. ... checks if the env "eureka.address" is set and if not, the default...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, guys here is the workaround for this, this is my
eureka-service.properties
:And then I’m able set
eureka.client.service-url.defaultZone
through environment variableSERVICE_URL_DEFAULT_ZONE
.Looks creepy, but it works!
@spencergibb the proposed solution is temporary workaround, it’s not a solution for initial problem.