Creating a Spring Reactive Controller is very similar to creating a Spring MVC Controller. The basic constructs are the same: @RestController and the different @RequestMapping annotations. The following snippet shows a simple reactive controller named StockPriceEventController:
@RestController public class StockPriceEventController { @GetMapping("/stocks/price/{stockCode}") Flux<String> retrieveStockPriceHardcoded (@PathVariable("stockCode") String stockCode) { return Flux.interval(Duration.ofSeconds(5)) .map(l -> getCurrentDate() + " : " + getRandomNumber(100, 125)) .log(); } private String getCurrentDate() { return (new Date()).toString(); } private int getRandomNumber(int min, int max) { return ThreadLocalRandom.current().nextInt(min, ...