Eureka Sever registers all my services, however when trying to access them through their application.name I cannot, I have tried RestTemplate and OpenFeign but it has not been possible in any way.

When FEATURES-SERVICE requests an image from IMAGES-SERVICE through: http://localhost:9005 work, but when FEATURES-SERVICE requests an image from IMAGES-SERVICE through: http://images-service fail.
This is my config for eureka-server:
server:
port: 8761
eureka:
client:
fetch-registry: false
register-with-eureka: false
and config for features-service and images-service
// IMAGES-SERVICE
server:
port:9005
spring:
application:
name: images-service
eureka:
client:
fetch-registry: true
register-with-eureka: true
service-url:
default-zone: http://localhost:8761/eureka
instance:
hostname: localhost
// FEATURES-SERVICE
server:
port:9004
spring:
application:
name: features-service
eureka:
client:
fetch-registry: true
register-with-eureka: true
service-url:
default-zone: http://localhost:8761/eureka
instance:
hostname: localhost
both services has the annotation @EnableEurekaClient in the Application file.
I was facing the same issue while using rest template and calling the other service, I got it running using the annotation @LoadBalanced on RestTemplate bean in my application class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With