Spring Webflux Server
This post walks you through the process of creating endpoints using Spring Webflux. Please read this previous Spring Webflux Basics post before continuing with this information. We are going to use @RestController to serve data from our PersonRepository. Let’s consider the following example:
package com.jos.dem.webflux.controller; import reactor.core.publisher.Mono; import reactor.core.publisher.Flux; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; import com.jos.dem.webflux.model.Person; import com.jos.dem.webflux.repository.PersonRepository; import lombok.extern.slf4j.Slf4j; @Slf4j @RestController @RequiredArgsConstructor public class PersonController { private final PersonRepository personRepository; @GetMapping("/persons") public Flux<Person> findAll() { log.
[Read More]