liveBook · Manning

Channel model

As explained in Spring in Action, Sixth Edition

The channel model is a bidirectional communication pattern in which both participants can send data at any time.

The channel model is RSocket’s bidirectional communication pattern: the client and server keep an open channel, stream multiple messages, and can send data at any time. section 14.1 section 14.2.4

A channel handler uses reactive streams on both sides:

  • The handler accepts a Flux of incoming requests from the client. section 14.2.4
  • The handler returns a Flux of responses that can stream back to the client. section 14.2.4
  • This two-way Flux arrangement distinguishes channels from request-stream communication, where the client sends only one request. section 14.2.4

Streaming gratuity calculations

A Spring controller can accept a Flux of GratuityIn values, calculate each bill’s gratuity, and return a Flux of GratuityOut values. A client sends several bills over an open channel and receives each calculated result as it becomes available. section 14.2.4

How Spring in Action, Sixth Edition covers it

How deep it goes
Explains Flux-based handler signatures and demonstrates Spring server and client code, without covering channel internals.
Examples
Demonstrates streaming gratuity requests and responses through Spring controller and RSocket client listings.
What it assumes
Distinguishes channels from request-stream communication and relies on familiarity with Spring handlers and Reactor Flux.
What you can do after
Build it from scratch with Spring using Flux-based RSocket handlers and clients for bidirectional message streams.
How it connects
Connects RSocket with request-response, request-stream, fire-and-forget, Spring, Flux, and Mono.

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.