Spring Reactive Programming Flashcards
What is reactive programming in Spring?
A programming paradigm focused on handling asynchronous data streams and non-blocking operations, supported by Spring WebFlux.
What is Spring WebFlux?
A reactive web framework in Spring for building non-blocking, asynchronous applications.
What is Mono in Spring WebFlux?
A reactive type representing a single asynchronous result or none.
What is Flux in Spring WebFlux?
A reactive type representing a stream of multiple asynchronous results.
What is @EnableWebFlux in Spring?
An annotation to enable Spring WebFlux for building reactive web applications.
What is the difference between Spring MVC and Spring WebFlux?
Spring MVC is synchronous and blocking, while WebFlux is asynchronous and non-blocking.
What is backpressure in reactive programming?
A mechanism for controlling the flow of data between producers and consumers to avoid overwhelming the consumer.
How do you handle errors in Spring WebFlux?
Using methods like onErrorResume() or onErrorReturn() to handle exceptions reactively.
What is Reactor in Spring?
A reactive library used by Spring WebFlux to implement the Reactive Streams API.
What is the @Controller annotation used for in Spring WebFlux?
It is used to define a reactive web controller in Spring WebFlux.