Reputation: 392
can I access to microservice with someting like this: Eureka Server: http://localhost:8761/ Microservice url: http://localhost:8080/ Call to Microservice to be something like: http://localhost:8761/name-service/ Is it posible? When i open the eureka server the service is registered.
eureka/application.properties:
server.port=8761
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
logging.level.com.netflix.eureka=OFF
logging.level.com.netflix.discovery=OFF
name-service/application.properties
spring.application.name=name-service
server.port=8080
How can i achieve this?
Upvotes: 5
Views: 5416
Reputation: 16465
The functionality you look for can be achieved using netflix zuul + netflix eureka. "name-service" is the name of your service with which you registered to eureka server. You should be hitting ZUUL microproxy address; not the eureka address
I suggest you start from here. https://spring.io/blog/2015/01/20/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka . This is a nice article by Josh Long
Upvotes: 4
Reputation: 392
I build zulu server. When i put in application.properties
zuul.routes.name-service.url=http://localhost:8888
ribbon.eureka.enabled=true
server.port=8080
works.
How to connect to read data from eureka registry? I tried like this but not working
zuul.routes.name-service.path=/name-service/**
zuul.routes.name-service.serviceId=name-service
eureka.client.serviceUrl.defaultZone=http://localhost:8761
Upvotes: 0