Does Spring Cloud Gateway support Rsocket for load-balancing? - spring-boot

I'm implementing a microservices system with Spring Boot, and I want to have a service that using Rsocket to make real-time connecting between user and system. But in the document of Spring Cloud Gateway, that's seem not support Rsocket. Is this possible to using Rsocket in a microservices system with Spring Boot ? Or should I using websocket instead ?
Here is my idea

Don't try this, lost time. See authoritative article
https://spring.io/blog/2020/03/25/spring-tips-spring-cloud-loadbalancer
https://spring.io/guides/gs/spring-cloud-loadbalancer/
https://cloud.spring.io/spring-cloud-gateway/reference/html/#the-websocket-routing-filter
https://cloud.spring.io/spring-cloud-gateway/reference/html/#the-loadbalancerclient-filter
https://cloud.spring.io/spring-cloud-gateway/reference/html/#reactive-loadbalancer-client-filter
For load balancing with Spring Cloud Gateway, let use technology stack [Eureka Discovery Client + Cloud Loadbalancer + Reactive Web] or Ribbon (Netflix Open Source Software - Netflix OSS).
Rsocket for "... Reactive Streams", load balancing need something like request/response round robin, these are different.

Related

Mixed Gateway HTTP-WEBSOCKET in a Spring Boot Application

In your opinion, in a hybrid architecture (WEBSOCKET + HTTP) is it good practice to use 2 gateways: Zuul for HTTP communication and Spring Cloud Gateway for WEBSOCKET communication in a Spring Boot application? Alternatively, in this scenario is it recommended to use only Spring Cloud Gateway?
Thanks.
is it recommended to use only Spring Cloud Gateway Yes because
Spring Cloud does not provide any out of the box integration with Zuul2. Gateway has many features that are not available in the public version of Zuul2 such as Rate limiting, etc. Also, with the gateway you can have custom filters defined per route and there are tons of built-in filters defined as well, which helps a lot to get started. Reference
Reference: I think SCG is the way to go due to the agreements between Netflix and Pivotal, with the former leaning more toward the spring boot/cloud ecosystem as stated in https://medium.com/netflix-techblog/netflix-oss-and-spring-boot-coming-full-circle-4855947713a0

Can Spring Cloud Gateway work with microservices that are not asynchronous?

I have a few synchronous microservices working on production using Spring Boot 2.X version. Soon, we need to implement a gateway if the number of instances of each microservice is going to be increased. I read that Zuul was in a maintenance phase and was replaced by Spring Cloud Gateway which is by default asynchronous technology. My question is, can I still implement Spring Cloud Gateway with my microservices?
Yes, you can use Spring Cloud Gateway without any doubts.
Basically, asynchronous technology means that your resources/threads on Api Gateway won't be blocked waiting for the response from downstream services and that increases a throughput.
Now, once your blocking services complete their internal logic they respond back to Api Gateway using an originally opened connection. Api Gateway in turn responds back to your client.

load balancer and Circuit Breaker

I search to use spring boot, spring-cloud-gateway, netflix eureka.
Is there anything to do to have a load balancer and circuit breaker for micro-service instance?
I found few information ex ribbon when spring gateway is used instead of zuul.
Actually I have an application for the gateway, another for eureka, another for thymeleaf client
security is not yet choose, probabley jwt
With Spring Cloud Gateway, you can currently use the Hystrix Gateway Filter.
Consider using Hystrix. It is extremely good for microservices and aligns well with Spring cloud stack. Also, take a look at Feign, due to its simplistic approach to communication between microservices and integration with hystrix and ribbon.

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.

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