How do you create a reactive REST API in Spring WebFlux?
Step-by-step guide to a reactive REST API in Spring WebFlux with Mono, Flux, a reactive repository, validation, SSE streaming and tests.
2,887 posts about Java: questions with answers, tutorials and articles, newest first.
Step-by-step guide to a reactive REST API in Spring WebFlux with Mono, Flux, a reactive repository, validation, SSE streaming and tests.
WebFluxConfigurer lets you customize Spring WebFlux defaults such as CORS, codecs, formatters and static resources. See the key methods with working examples.
Learn Project Reactor basics: build Mono and Flux pipelines, combine async calls, handle errors and retries, avoid blocking, and test with StepVerifier.
Write a custom Spring Boot health indicator with Actuator, add details and statuses, and wire it into readiness probes for reliable monitoring.
Spring Boot has no @EnableActuator annotation. Add spring-boot-starter-actuator, choose exposed endpoints, secure them and add custom health checks.
Set up Spring Boot Actuator and Micrometer to expose JVM, HTTP and custom metrics, scrape them with Prometheus and secure the endpoints.
ErrorController lets you replace Spring Boot's default /error handling. See how BasicErrorController works and which lighter options usually fit better.
Return consistent JSON errors from a Spring Boot API with @RestControllerAdvice, @ExceptionHandler, validation errors and the standard ProblemDetail type.
Centralize error handling with @RestControllerAdvice and @ExceptionHandler, and return standard ProblemDetail responses. Includes validation errors and best practices.
When to use @Value and when to use @ConfigurationProperties in Spring Boot, with record-based examples covering validation, relaxed binding and testing.
Configure Spring Boot per environment using application-dev and application-prod files, spring.profiles.active, YAML documents, @Profile beans and profile groups.
spring.main.banner-mode controls whether Spring Boot prints its startup banner to the console, to the log, or not at all. Learn the values and how to customise it.
Learn where Spring Boot reads application.properties, which common keys to set, and how profiles, environment variables and ConfigurationProperties override them.
spring-boot-starter is the core Spring Boot starter with auto-configuration, logging and YAML support. See what it includes and how other starters build on it.
Set up application.yml in Spring Boot 3: server and datasource settings, profile documents, typed custom properties, external imports and secrets.
@SpringBootApplication is shorthand for configuration, auto-configuration and component scanning. See what each part does and how to tune it.
Run mvn clean package from the folder with pom.xml to compile, test and package your project. This guide covers phases, options and common build errors.
mvn clean deletes the target directory so the next Maven build starts from scratch. See the clean lifecycle, when to use it and how to configure it.
Compile, provided and runtime scopes decide which classpath a Maven dependency joins and whether it ships in your artifact. Learn when to use each.
Set up a Maven parent POM and child modules, understand inheritance versus aggregation, and share versions with dependencyManagement.