Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Node js app register to Spring eureka?

Is it possible to implement node js app as a spring eureka client? I use eureka-js-client to register spring eureka server, it always response 404 error.

like image 881
Sidney Avatar asked May 12 '16 13:05

Sidney


People also ask

How do I register a project with Eureka server?

First, you need to add the following dependencies in our build configuration file to register the microservice with the Eureka server. Now, we need to add the @EnableEurekaClient annotation in the main Spring Boot application class file.

What is Eureka js client?

A JavaScript implementation of a client for Eureka (https://github.com/Netflix/eureka), the Netflix OSS service registry.

How Eureka Service Registry works?

Eureka Server is an application that holds the information about all client-service applications. Every Micro service will register into the Eureka server and Eureka server knows all the client applications running on each port and IP address. Eureka Server is also known as Discovery Server.

How does Spring cloud Eureka work?

With Netflix Eureka, each client can simultaneously act as a server to replicate its status to a connected peer. In other words, a client retrieves a list of all connected peers in a service registry, and makes all further requests to other services through a load-balancing algorithm.


2 Answers

Yes It is possible, Check these three files in repo.

eureka: {
    host: 'localhost',
    port: 8761,
    servicePath: '/eureka/apps/'
  }

To this part in server.js you have to a add your own details (port and host details, If you have hosted in seperate machine you should add that machine's IP address as host)

like image 38
isuruAb Avatar answered Sep 21 '22 08:09

isuruAb


Check out the README of eureka-js-client for some helpful tips on this error.

If you are using Spring Cloud you'll likely want to set servicePath under the eureka section of your client configuration to /eureka/apps/.

like image 133
JQ- Avatar answered Sep 21 '22 08:09

JQ-