package com.nisum; import com.nisum.model.Order; import com.nisum.model.Product; import com.nisum.service.FlowAppService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Flux; @Slf4j @RestController public class MyController { @Autowired FlowAppService flowAppService; @GetMapping("/home") public void getHome(){ log.info("Welcome home ...."); } @GetMapping(value="/myOrders") public Flux getAllOrders() throws InterruptedException { return flowAppService.getOrderUsingPublisher(); } @GetMapping("/myProducts") public Flux getAllProducts() throws InterruptedException { return flowAppService.getProductsUsingPublisher(); } }