To work in functional way, the very first thing we need to do is to make our project WebFlux aware. For that we need to add the @EnableWebFlux annotation to the main bootstrap class as follows:
@SpringBootApplication
@EnableWebFlux
public class SpringWebFluxDemoApplication {
// other code ..
}
We also need to instruct Spring that the application is of the reactive type by adding the following property in the application.properties file:
spring.main.web-application-type=reactive