liveBook · Manning

RSocket controller

As explained in Spring in Action, Sixth Edition

An RSocket controller is a Spring component whose message-handler methods respond to requests addressed to configured RSocket routes.

An RSocket controller is a Spring component whose message-handler methods respond to client requests addressed to configured routes. Unlike a web controller, it maps messages with @MessageMapping instead of mapping HTTP paths. section 14.2.1

A request-response handler typically:

  • Accepts the incoming payload as Mono<String> or another suitable type. section 14.2.1
  • Transforms the payload with Mono.map() and returns a reactive response. section 14.2.1
  • Uses route placeholders such as greeting/{name}, with @DestinationVariable extracting the value. section 14.2.1

Greeting route

A @Controller method mapped to greeting logs the received message and returns “Hello back to you!”. A client can call greeting/{name} and receive a personalized response.

How Spring in Action, Sixth Edition covers it

How deep it goes
Explains route mapping, reactive payload handling, variables, and port configuration, but stops short of broader server internals.
Examples
Uses greeting and greeting/{name} routes, reactive greeting handlers, port 7000, and RSocketRequester client calls.
What it assumes
Assumes basic Spring controller familiarity while introducing RSocket routes, reactive Mono payloads, and destination variables.
What you can do after
Apply it via Spring annotations and RSocketRequester to build and call a reactive greeting service.
How it connects
Connects RSocket controllers with Spring MVC controllers, @MessageMapping, @DestinationVariable, Mono, and RSocketRequester.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.