This repository contains exercise solutions and hands-on labs for a comprehensive Reactive Spring training course.
A 5-hour intensive workshop teaching reactive programming with Spring Boot, Spring WebFlux, and Project Reactor through practical exercises covering:
- REST Clients: RestClient, WebClient, and HTTP Interfaces
- Reactive Data Access: Spring Data R2DBC with H2 database
- Reactive Web Programming: Both annotated controllers and functional approaches
- Testing: Comprehensive test coverage with WebTestClient and StepVerifier
- Schedulers: Thread management and handling blocking operations
reactive-spring/
├── labs.md # Complete lab exercises and instructions
├── slides.md # Slidev presentation (35 slides, 5-hour course)
├── restclient/ # REST client examples and solutions
│ ├── RestClient # Modern synchronous HTTP access
│ ├── WebClient # Reactive HTTP access
│ └── HTTP Interfaces # Spring 6+ declarative clients
└── reactive-customers/ # Reactive Spring Data + WebFlux
├── Annotated Controllers # Traditional @RestController approach
├── Functional Programming # RouterFunction approach
├── R2DBC Integration # Reactive database access
└── Comprehensive Tests # WebTestClient and repository tests
- Spring Boot 3.5.3 - Latest stable release
- Spring WebFlux - Reactive web framework
- Spring Data R2DBC - Reactive database access
- Project Reactor - Reactive streams implementation
- H2 Database - In-memory database for examples
- JUnit 5 - Testing framework
- Gradle 8.14.2 - Build tool
- Java 17 or later
- IDE with Spring Boot support (IntelliJ IDEA, Eclipse, VS Code)
-
Clone the repository
git clone <repository-url> cd reactive-spring
-
Build all projects
./gradlew build
-
Run individual projects
# REST client examples ./gradlew :restclient:bootRun # Reactive customers application ./gradlew :reactive-customers:bootRun
-
Run tests
# All tests ./gradlew test # Specific project tests ./gradlew :reactive-customers:test
- View the presentation -
slides.md(use Slidev or any Markdown viewer) - Follow the labs -
labs.mdcontains complete step-by-step exercises - Check the solutions - Working implementations in each project
- Run the tests - See reactive programming patterns in action
- Experiment - Modify code and observe reactive behavior
The labs.md file contains detailed exercises covering:
- Building a REST Client - RestClient basics and JSON parsing
- Asynchronous Access - WebClient and reactive streams
- HTTP Interfaces - Spring 6+ declarative HTTP clients
- Project Reactor Tutorial - Flux and Mono fundamentals
- Working with Schedulers - Thread management and blocking operations
- Reactive Spring Data - R2DBC and reactive repositories
- Annotated Controllers - Traditional Spring MVC style with reactive types
- Functional Web Programming - RouterFunction and handler-based approach (Optional)
- Understand reactive programming concepts and benefits
- Master Project Reactor's Flux and Mono types
- Build reactive REST clients using multiple approaches
- Control thread execution with schedulers for blocking operations
- Implement reactive data access with R2DBC
- Create reactive web endpoints using both programming models
- Write effective tests for reactive applications
- Handle backpressure and reactive stream lifecycle
This repository represents a complete, production-ready example of reactive Spring applications with:
- ✅ 100% test coverage - All examples include comprehensive tests
- ✅ Latest Spring Boot - Uses current stable releases and best practices
- ✅ Multiple approaches - Demonstrates both traditional and functional styles
- ✅ Real-world patterns - Includes error handling, testing, and configuration
- ✅ Clean architecture - Well-organized, documented, and maintainable code
- slides.md - Complete 35-slide Slidev presentation covering reactive concepts
- View with Slidev:
npx @slidev/cli slides.md - Includes course overview, testing tools, and progressive reveal animations
- Or open in any Markdown viewer for reference
- Spring WebFlux Documentation
- Project Reactor Documentation
- Spring Data R2DBC Reference
- Reactive Streams Specification
- Slidev Documentation - For presentation framework
This repository is designed for hands-on learning. Follow the labs, explore the code, run the tests, and experiment with reactive programming concepts to master Spring's reactive stack.