...
/Converting a Webflux Request Into an RSocket Fire-And-Forget
Converting a Webflux Request Into an RSocket Fire-And-Forget
Learn how to forward a new item over RSocket using fire-and-forget and then test those interactions.
We'll cover the following...
Forwarding item
using fire-and-forget
If we take a look at the following flow, we can see how to use RSocket’s fire-and-forget paradigm:
@PostMapping("/items/fire-and-forget")Mono<ResponseEntity<?>> addNewItemUsingRSocketFireAndForget(@RequestBody Item item) {return this.requester.flatMap(rSocketRequester -> rSocketRequester.route("newItems.fire-and-forget") // <1>.data(item).send()) // <2>.then( // <3>Mono.just(ResponseEntity.created(URI.create("/items/fire-and-forget")).build()));}
Forwarding a new Item over an RSocket using fire-and-forget
Here’s a breakdown of the code above:
-
In line 5, the example forwards the incoming request to the destination
newItems.fire-and-forget
. ...