liveBook · Manning

Sink node

As explained in Spring Start Here, Second Edition

A subscriber is a reactive component that attaches to a producer and consumes its eventual result.

In a reactive task flow, a subscriber is the consuming end of a dependency: it attaches to another task’s producer and consumes that task’s result when it finishes. Tasks declare these dependencies instead of keeping a thread waiting during I/O. section 11.4

WebClient request chain

WebFlux subscribes to the producer returned by the controller’s action. WebClient, in turn, subscribes to a task that supplies the request body. section 11.4

Figure 11.10 The tasks chain in a reactive app. When building a reactive web app, we define the tasks and the dependencies between them. The WebFlux functionality, initiating the HTTP request, subscribes to the task we create through the producer the controller’s action returns. In our case, this producer is the one we get by sending the HTTP request with WebClient. For WebClient to make the request, it subscribes to another task that provides the request body.

Follow the subscriptions from the controller’s returned producer to the task supplying the request body. section 11.4

How Spring Start Here, Second Edition covers it

How deep it goes
Defines producer and subscriber roles and traces a WebClient subscription chain, but does not explain subscriber internals.
Examples
Uses a WebClient payment request and its request-body task to illustrate chained subscriptions.
What you can do after
Understand how one reactive task consumes another task’s result while expressing a dependency without keeping a thread waiting.
How it connects
Ties reactive tasks to producers, WebClient, WebFlux, and nonblocking I/O.

Also explained in

Compare how 7 books explain sink node →

Related concepts

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