I am using ...
Spring Boot: 2.2.0.RELEASE
Spring Cloud: Hoxton.BUILD-SNAPSHOT
Sample project:here"Fixed" project:here
I tried to follow the presentation and declarative routing information as shown here at the Spring One conference.
There is an issue with declarative routing / forwarding information specified in application.yml of an RSocket client, if the route contains dots (.).
Above you can find a sample that consists of the following components:
reservation-service - an RSocket client exposing an endpoint by the route create.reservation that will be called by reservation-service-client via the gateway.
reservation-service-client - an RSocket client exposing a WebFlux API to receive POST requests that get translated into an RSocket request to reservation-service.
service-gateway - the RSocket broker-enabled SCG
With reservation-service-client's application.yml specifying the following routing metadata the gateway will fail forwarding the request with a NullPointerException since the client does not send the routing metadata properly:
The issue is in the dotted syntax of the route, which in a Yaml file gets interpreted as a hierarchy.
I guess the matching between the client's called route, and the routing information in Yaml therefore fails.
A working sample is also given above, which uses dashes instead of dots.
To reproduce:
start service-gateway
start reservation-service
start reservation-service-client
Send a POST request with empty body to http://localhost:6666/reservation/create/RSocketRules
See also #1 which is related, but note that it additionally uses dynamic parts in the route.
I am using ... Spring Boot: 2.2.0.RELEASE Spring Cloud: Hoxton.BUILD-SNAPSHOT Sample project: here "Fixed" project: here
I tried to follow the presentation and declarative routing information as shown here at the Spring One conference.
There is an issue with declarative routing / forwarding information specified in
application.yml
of an RSocket client, if the route contains dots (.
).Above you can find a sample that consists of the following components:
reservation-service
- an RSocket client exposing an endpoint by the routecreate.reservation
that will be called byreservation-service-client
via the gateway.reservation-service-client
- an RSocket client exposing a WebFlux API to receivePOST
requests that get translated into an RSocket request toreservation-service
.service-gateway
- the RSocket broker-enabled SCGWith
reservation-service-client
'sapplication.yml
specifying the following routing metadata the gateway will fail forwarding the request with aNullPointerException
since the client does not send the routing metadata properly:The issue is in the dotted syntax of the route, which in a Yaml file gets interpreted as a hierarchy. I guess the matching between the client's called route, and the routing information in Yaml therefore fails.
A working sample is also given above, which uses dashes instead of dots.
To reproduce:
service-gateway
reservation-service
reservation-service-client
POST
request with empty body tohttp://localhost:6666/reservation/create/RSocketRules
See also #1 which is related, but note that it additionally uses dynamic parts in the route.