Does Eureka support non-RESTful endpoints? - microservices

Does Netflix Eureka support non-RESTful endpoints? We have a requirement where clients should be able to discover the AMQP based endpoints provided by RabbitMQ.
It seems main competitors to Eureka such as Consul and Zookeeper are essentially key-value stores and you can store anything in the value.

Related

Service discovery for microservices

I need some help in understanding how we implement service discovery for microservices in kubernetes.
Im going through some tutorials on spring boot and noticed that wr need to use Eureka discovery for implementing service discovery for maintaining communication b/w microservices. But my question is if we deploy those spring boot microservices in kubernetes, do we still need to use Eureka tool? We can use kubernetes services for implementing service discovery and load balancing right?
Kubernetes orchestration platform provides CoreDNS for Service discovery. Micro services when they get deployed to the platform can utilise the services by default no need to implement it unless if there is specific requirements which is not satisfied . Kubernetes Loadbalancer services type can be used for load balancing of services

What is the use of Eureka Server in Microservices architecture

I am using "Spring Cloud Gateway" in my microservices application
Ex:
spring.cloud.gateway.routes[0].id=mydemoservice
spring.cloud.gateway.routes[0].uri=http://localhost:8100/
spring.cloud.gateway.routes[0].predicates[0]=Path=/mydemoservice/**
In this case if the request is coming from client like : http://localhost:8100/mydemoservice/api/getdetails
in this case "Spring Cloud Gateway" will route the request to respective service.
But why is Eureka Server required here ? I am not really understanding Eureka Server use here can some please explain.
Best I could find is this medium article which depicts the problems and solutions Eureka provides.
https://medium.com/javarevisited/how-to-use-spring-cloud-gateway-to-dynamically-discover-microservices-194c0c3869c6
This comes to shine when you deploy services with horizontal auto scalability (such as kubernetes). At certain moments, based on the equation you configure (recourse usage, client connections, etc.) the orchestration can and will scale your services (e.g. mydemoservice). It can scale your service instance up to:
the configured max number of instances
until the service usage limit is reached
either way, all of them will have different IP addresses.
Eureka is a discovery/registry service which provides to your gateway information of which cluster/load balancer (IP address) will it pass the request based on Round Robins and such algorithms. The gateway needs to configure all of the services but it will use aliases provided by the Eureka server depicted as such:
https://github.com/rubykv/code-examples/blob/master/gateway/src/main/resources/application.yml
In this example, we see the gateways are configured for services: subject, student, and eureka.
Eureka has a dashboard:
https://miro.medium.com/max/1400/1*KgT1_hnuXvX6xldyiJJuaQ.png
and will display all eureka clients. To display a service as a eureka client one must implement:
https://github.com/rubykv/code-examples/blob/master/student/pom.xml (netflix eureka and open feign)
annotate application with #EnableFeignClients https://github.com/rubykv/code-examples/blob/master/student/src/main/java/com/example/demo/StudentApplication.java
There are lots of tutorials and articles on medium, I hope this helps for your further investigation.

Consul with Spring Cloud Gateway - Inter Service Communication

The setup:
I have a set of Spring Boot based microservices that are fronted by Spring Cloud Gateway, meaning every request that comes from UI or external API client first comes to Spring Cloud Gateway and is then forwarded to appropriate microservice.
The routes are configured in Consul, and Spring Cloud Gateway communicates with Consul to get the routes accordingly.
Requirement:
There is a need of some microservices communicating with each other with REST APIs. I would prefer this communication to happen via the Spring Cloud Gateway as well. This will help in reducing multiple services going to Consul for getting other service's details.
This means every service should know Gateway's detail at least. And there can be multiple instances of Gateways as well. How is this dealt with in bigger architectures?
Any example that I look up contains one service using Consul, or Gateway using the consul with one microservice. Couldn't understand how to extrapolate that design to a bigger system.

what is the difference between netflix zuul server and netflix eureka server?

i have created two java spring-boot micro services they are
1) producer
2) consumer
and i have used spring eureka server for service registration and discovery . it worked fine . then what is the use of Netflix Zuul.
Let's suppose you have 20 services to which user can interact to, and of course we are not going to expose each and every services publicly because that will be madness (because all services will have different ports and context), so the best approach will be to use an API gateway which will act as single entry point access to our application (developed in micro service pattern) and that is where Zuul comes into picture. Zuul act as a reverse proxy to all your micro-services running behind it and is capable of following
Authentication
Dynamic Routing
Service Migration
Load Shedding
Security
Static Response handling
Active/Active traffic management
You can go through documentation here
If you have enough experience in the domain, you could look at zuul as an API gateway like Apigee. It is very feature rich and touches up on a lot of different concerns like routing, monitoring and most importantly, security. And eureka as a service discovery platform that allows you to load balance (in Linux terms the nginx or haproxy) and fail over between your service instances.
Typically the backend services that perform the server side business operations (i.e. core) are not exposed publicly due to many reasons. They are shielded by some Gateway layer that also serves as reverse-proxy. Netflix Zuul serves as this gateway layer which easily gives you the capabilities as mentioned by #Apollo and here

Creating a Client/Service in Netflix Eureka

With regards to the Netflix Eureka Service Registry, I have setup the Eureka Netflix Server using Tomcat 8.0.35 successfully. I have also got the basic Example Service & Client to communicate with each other. I'm still new to Eureka and the management decision is to use Eureka with Spring as several new applications are written around the Spring framework.
I have been following the wiki in order to understand how the communication works (But with little to no success with registering services).. Eureka Github Wiki.
My question is: Do I need to create my own Eureka Service & Client in order to maintain a registry of about 50 cloud instances? (If so, can you please point me in the right direction).
I have hands on experience with Consul/RESTfull API, and have implemented Consul in production (using php, and qbit); however the Netflix Eureka Registry look's as though I need to learn eureka/spring + client/server java programming? I'm still getting used to the following terms.
Eureka Server (I successfully got this working using Tomcat8/JDK1.8 + the eureka.war)
Eureka Service (Some kind of stand-alone RESTfull service that queries the Eureka-Server and listens for client requests)
Eureka Client (Java snippet to be embedded into the Java servlets/jsp)?
Zuul (A type of routing/load-balancing app - similar to HaProxy ?)
Ribbon (A type of routing/load-balancing app - similar to HaProxy ?)
I would like to get the Service & Client configured for mostly non-AWS cloud instances. The Eureka Wiki is not very helpful when it comes to creating a working eureka service & client. Any help to point me in the right direction to implement a Eureka based RESTfull system would be helpful.
I suggest you to read this documentation about spring-cloud : http://cloud.spring.io/spring-cloud-static/spring-cloud.html
It should be a good start to setup a few simple spring-boot/spring-cloud services and start to use advanced tools like zuul/ribbon/hystrix ...
There is a simple example of distributed system using Spring Boot and Spring Cloud Netflix.
This project contains the following microservices:
requestor and responder which communicates via REST/HTTP
gateway microservice - Spring Boot app + Zuul
discovery microservice - Spring Boot app + Eureka
Moreover, requestor microservice uses Hystrix library.
As you can see, Spring Cloud provides a really good wrapper for Netflix solutions. As a result, you can start quickly with minimal configuration.

Resources