Skip to main content

Module 14: Advanced Spring Boot Techniques

Module Objectives​

By the end of this module, you will be able to:

  • Understand reactive programming with Spring WebFlux
  • Implement a cache system with Redis
  • Configure asynchronous messaging with RabbitMQ
  • Create scheduled tasks with @Scheduled
  • Develop real-time applications with WebSockets

Prerequisites​

Before starting this module, make sure you master:

  • Modules 1-12: Complete Spring Boot Basics
  • Module 13: Microservices Architecture
  • Docker (for Redis, RabbitMQ)
  • Concepts of asynchronous programming

Module Plan​

Theoretical Chapters​

#ChapterDurationDescription
1Reactive Programming1h30WebFlux, Mono, Flux, R2DBC
2Cache with Redis1h@Cacheable, @CacheEvict, Redis
3Asynchronous Messaging1h15RabbitMQ, Spring AMQP
4Scheduled Tasks45min@Scheduled, @Async, Cron
5WebSockets1hSTOMP, SockJS, real-time

Practical Work​

#LabDurationDescription
1Redis Cache1hAPI caching
2RabbitMQ Messaging1h30Notification system
3WebSocket Chat1h30Real-time chat application
4Scheduled Tasks45minBatch and automatic reports

Estimated total duration: 10 hours


Key Concepts​

Reactive vs Imperative Programming​

Imperative (Spring MVC):
- Thread per request
- Blocking
- Simple to understand
- Limited scalability

Reactive (WebFlux):
- Event loop
- Non-blocking
- High scalability
- Learning curve

When to Use What​

Use CaseTechnology
Classic CRUD APISpring MVC
High concurrencyWebFlux
Frequently read dataRedis Cache
Service decouplingRabbitMQ
Real-time notificationsWebSocket
Periodic reports@Scheduled

Technical Stack​

TechnologyVersionUsage
Spring WebFlux3.2.xReactive programming
Project Reactor3.6.xMono/Flux
Redis7.xDistributed cache
RabbitMQ3.12.xMessage broker
STOMP1.2WebSocket messaging

Labs Architecture​

Advanced Application
├── REST API (Spring MVC or WebFlux)
├── Cache Layer (Redis)
├── Messaging (RabbitMQ)
├── WebSocket (STOMP)
└── Scheduled Tasks

Ready to Start​

Make sure you have Docker installed for this module:

# Check Docker
docker --version

# Start Redis
docker run -d --name redis -p 6379:6379 redis:7-alpine

# Start RabbitMQ
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

Start Chapter 1: Reactive Programming


Back to home