5
votes

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?

2
No. Eureka is a Service registry, not a proxy. If i understand you correctly, what you want, is Zuul: github.com/Netflix/zuuldunni

2 Answers

4
votes

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

0
votes

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