spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.51k stars 3.31k forks source link

Rsocket & Websocket in Webflux mode on Spring Cloud #3053

Open kasra-haghpanah opened 1 year ago

kasra-haghpanah commented 1 year ago

In my opinion, at the moment, one of the weaknesses of the Spring framework is the failure to finish Rsocket and Websocket in Webflux mode for Spring-cloud-gateway, even making a message broker that supports Rsocket and Reactive HTTP at the same time. In addition to adding these affairs, adding general maps automatically like Redis for keeping Websocket or Rsocket sessions easily helps developers broadcast data across these sessions through multiple machines.

spencergibb commented 6 months ago

spring-cloud-function supports rsocket and can integrate easily with forward: routes

spring-cloud-issues commented 6 months ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

kasra-haghpanah commented 6 months ago

Unfortunately, I couldn't find an example to illustrate how to config spring-cloud-function in RSocket mode from beginning to end, so I can't give my opinions to you. It would be great if it was implemented like this: as we can set Proxy in spring-cloud-gateway in Websocket and HTTP mode, this issue is possible in RSocket mode as well. For example, according to the following config supports Websocket in spring-cloud-gateway. If it also supported Rsocket, it would be great, and turn into the far best and easiest cloud gateway, and yet lightest in comparison with other existing gateways.

.route("websocket_route", routeSpec -> { // for websocket return routeSpec .path("/customer/websocket")// path on gateway .filters(gatewayFilterSpec -> { return gatewayFilterSpec.setPath("/customer/websocket"); // path on microservice }) .uri("lb://customer"); })

kasra-haghpanah commented 6 months ago

Is it possible to implement Rsocket to enable using RouteLocater in Spring-Cloud-Gateway? So that there is the ability to use HTTP and RSocket simultaneously on the same platform like Spring-Cloud-Gateway.