Skip to content

Fix Eureka registering unreachable hostname on Windows#32

Merged
arey merged 1 commit intospring-petclinic:mainfrom
moimenta84:fix/eureka-prefer-ip-address
Mar 26, 2026
Merged

Fix Eureka registering unreachable hostname on Windows#32
arey merged 1 commit intospring-petclinic:mainfrom
moimenta84:fix/eureka-prefer-ip-address

Conversation

@moimenta84
Copy link
Copy Markdown
Contributor

Summary

  • Add eureka.instance.prefer-ip-address: true to the shared application.yml so all microservices register their IP address in Eureka instead of the system hostname
  • On Windows, the hostname is often unresolvable from other containers, causing routing failures when services try to communicate via the gateway
  • Centralising this in the config server avoids repeating the setting in each microservice's local application.yml

Fixes spring-petclinic/spring-petclinic-microservices#487

Test plan

  • Run docker-compose up on Windows and verify all services register with an IP address in the Eureka dashboard (http://localhost:8761)
  • Verify inter-service calls succeed (e.g. api-gateway → customers-service)

Add eureka.instance.prefer-ip-address: true to the shared config so all
microservices register their IP address in Eureka instead of the system
hostname. On Windows, the hostname is often unresolvable from other containers,
causing routing failures. Fixes spring-petclinic/spring-petclinic-microservices#487.
@arey
Copy link
Copy Markdown
Member

arey commented Mar 26, 2026

Thank you @moimenta84
I've tested on my Macbook and it's working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Gateway Registers Unreachable/Wrong Hostname in Eureka on Windows, Causing 405 and Timeout Errors

2 participants