Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access to Microservices via Eureka Server

Tags:

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?

like image 817
zafirov Avatar asked Nov 02 '16 10:11

zafirov


People also ask

Are microservices dependent on Eureka?

Eureka provides service discovery in a microservices architecture. This involves two steps on a high level: Services registers themselves on the Eureka server and details like name, host, and port are stored there. Details of other registered microservices become available for the registered service.

Can we create microservices without Eureka server?

A short answer Yes, you can survive with Spring Cloud API Gateway and no Service Discovery. But it's really dependent on the size of your application and the amount of traffic it will be handling. You can start migration to microservices without Service discovery.

Is Eureka server an API gateway?

Eureka Server: It is an application that contains information about all client service applications. Each microservice is registered with the Eureka server and Eureka knows all the client applications running on each port and IP address. Eureka Server is also known as Discovery Server.


1 Answers

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

like image 97
so-random-dude Avatar answered Sep 25 '22 16:09

so-random-dude