Spring WebFlux : Annotated Controllers vs Functional Endpoints

Asked on September 03, 2020
What is difference between Annotated Controllers and Functional Endpoints in
Spring WebFlux and when to use Annotated Controllers and when to use Functional Endpoints?

Replied on September 04, 2020

Annotated Controllers:

1. In annotation based programming, Spring WebFlux uses same annotations from Spring Web MVC module. 

2. Spring Web MVC and Spring WebFlux both supports reactive return types such as Reactor and RxJava.

3. Spring WebFlux supports reactive @RequestBody arguments.


Functional Endpoints:

1. The introduction of Lambda expression in Java, enables functional programming. The Functional Endpoints are lambda-based, lightweight and follow functional programming model.

2. Functional Endpoints are a set of libraries that an application can use to route and handle requests.

3. Functional Endpoints are in charge of request handling from start to finish whereas Annotated Controllers declare intent through annotations and being called back.


Write Answer

©2024 concretepage.com | Privacy Policy | Contact Us