What are WebFlux and Mono in Spring Boot?

Spring WebFlux is Spring's reactive, non-blocking web framework built on Project Reactor, designed to handle high volumes of concurrent requests with a small number of threads. Mono is one of WebFlux's two core reactive types, representing an asynchronous stream that emits at most one item or completes empty.

Key Points

Example

A service method that fetches a single user by ID returns Mono<User> instead of User, and the caller chains .map() or .flatMap() to transform the result once it becomes available, without blocking the calling thread.

@GetMapping("/users/{id}")
public Mono<User> getUser(@PathVariable String id) {
    return userRepository.findById(id)
            .switchIfEmpty(Mono.error(new UserNotFoundException(id)));
}

Interview Tip

A concise interview answer is

WebFlux is Spring's reactive stack for non-blocking, asynchronous web applications, typically running on Netty. Mono represents a stream that emits zero or one value, which I use for operations like fetching a single record, as opposed to Flux, which handles zero-to-many streams.

Last updated: 11 November 2026

Previous question: What are traceId and spanId in Spring Boot microservices, and what are they used for?

Next question: How do you create a custom annotation in Java?

More Spring Boot - Level V (Expert) interview questions

All Spring Boot - Level V (Expert) questions