Creating a RSocket Client

Learn how to configure a client-side REST controller.

Configuring a client-side REST controller

Let’s create a WebFlux controller that will take incoming HTTP requests and forward them to the back-end server over its RSocket connection. That’s perhaps not as sophisticated as, say, a template that uses WebSockets to communicate from the browser to the backend. That said, learning how RSockets work makes for an effective example.

We’ll do this by creating a class called RSocketController in our newly-minted rsocket-client application in the com.greglturnquist.hackingspringboot package as follows:

Get hands-on with 1400+ tech skills courses.