Note: Here the terms Subscriber and Subscription are being used from the reactive streams specification.
Consider the following @RestController methods in a spring boot webflux based microservice.
@GetMapping(path = "/users", produces = MediaType.APPLICATION_JSON_VALUE)
public Flux<TradingUser> listUsers() {
return this.tradingUserRepository.findAll();
}
@GetMapping(path = "/users/{username}", produces = MediaType.APPLICATION_JSON_VALUE)
public Mono<TradingUser> showUsers(@PathVariable String username) {
return this.tradingUserRepository.findByUserName(username);
}
Here "who/what" will act as the "Subscriber"? I assume the spring boot framework provides a Subscriber(?) Can someone please provide details or any links around this?
Say I am invoking the restful endpoint above using client like postman/curl/browser, then in that case how can the client signal demand to the reactive server? (Only the Subscriber has a handle on the Subscription object with the request(n) method to signal demand. However, since Subscriber is probably also on the server side implemented by the spring boot framework, how can the actual client signal the demand?) I am obviously missing something.