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.
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.
A JavaScript implementation of a client for Eureka (https://github.com/Netflix/eureka), the Netflix OSS service registry.
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.
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.
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)
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/
.
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