...
/Converting a Webflux Request Into an RSocket Request/Response
Converting a Webflux Request Into an RSocket Request/Response
Learn how to forward a new item over RSocket and create a test class using the autoconfigured WebTestClient.
We'll cover the following...
We'll cover the following...
Forwarding Item using request/response
Check out the code below to see how we can connect an incoming HTTP POST with WebFlux to our RSocket request/response method on the server.
Forwarding a new Item over an RSocket using request/response
Here’s a breakdown of the code above:
-
In line 1,
@PostMapping(...)indicates that this Spring WebFlux method acceptsHTTP POSTrequests at the/items/request-responseroute. -
In line 5, we can
route()this request to the destinationnewItems.request-responseby flat mapping over theMono<RSocketRequestor>. -
In line 6, we submit the payload of the
Itemobject in thedata()method. -
In line 7, we signal that we ...