Course · Training · Workshop
Introduction to Spring Boot Microservices
Two days hands-on: evolve a Spring Boot application from a monolith through a modular monolith with Spring Modulith to microservices behind a Spring Cloud Gateway.
Many Java teams run Spring Boot applications that have grown over years: packages reach directly into each other, changes ripple through the code base, and the question is whether microservices are the next step. Anyone joining such a project wants to understand how the Spring container, auto-configuration, Spring Data and Spring Security work together.
In this course you evolve a course management application step by step. You start with a Spring Boot monolith with a REST API, Spring Data JPA and PostgreSQL in Docker Compose. With Domain-Driven Design you cut the modules and enforce their boundaries with Spring Modulith: named interfaces, events and tests that report violations. You then extract two modules as independent services, connect them over REST and put a Spring Cloud Gateway in front. The saga pattern, service discovery and OAuth 2.0 with JWT show what distributed systems add.
At the end you have built the same application in three architectures and can justify for your own system which one fits and which next step is worth taking.
What participants say
Very good Spring Boot course for beginners or already advanced Spring users.
The course was a good introduction to Microservices with Spring Boot. We can now start discussing how we want to build up our microservice structure and whether it is necessary to destructure existing monoliths
Full Stack Developer






These customers booked courses in the same topic cluster.More customers →
Content
This training is for Java teams who develop Spring Boot applications and decide on their architecture. You build a course management application as a monolith, structure it into modules with Spring Modulith and extract independent services from it.
The course consists of the following topics and can be adapted to the audience. The first day covers Spring Boot and the monolith, the second day the modular monolith and the step to microservices. In two days we set the focus according to the questionnaire; for in-house courses we agree depth and duration.
Spring and Spring Boot fundamentals
- Inversion of control, dependency injection and the Spring container
- Auto-configuration, starter dependencies and the embedded server
- Setting up a project with Spring Initializr and Maven, faster development with Spring Boot DevTools
- Spring Boot Actuator with health, metrics and info endpoints
- Hands-On: Set up the Course Service as a Spring Boot monolith with CRUD functions and test it with curl
Data persistence with Spring Data JPA
- Entities, repositories and queries
- Relationships and cardinalities between entities
- Paging and sorting
- H2 as in-memory database and PostgreSQL in a container, Flyway and Liquibase in context
- Hands-On: Store and query Course and Trainer as a one-to-many relationship with JPA repositories
REST services with Spring MVC
- REST controllers, request mapping, path and request parameters
- Content negotiation, ResponseEntity and HTTP status codes
- Error handling with @ExceptionHandler and @RestControllerAdvice
- Validation with Bean Validation and CORS configuration
- API-first approach and API documentation with OpenAPI (Swagger)
- Hands-On: Extend the course management application with an Enrollment module with REST API and OpenAPI documentation
Configuration, profiles and containers
- Constructor injection, bean scopes and conditional beans
- External configuration with properties, YAML and environment variables
- Profiles for development, test and container
- Container images with a Dockerfile or Cloud Native Buildpacks (mvn spring-boot:build-image)
- Hands-On: Containerise the application with its own profile and start it together with PostgreSQL in Docker Compose
Domain-Driven Design and Spring Modulith
- Bounded contexts, entities, value objects and domain events
- Cutting the modules of the course management application: Course Management, Enrollment and Notification
- Detecting modules from the package structure, @ApplicationModule and allowed dependencies
- Public API and internal packages, named interfaces with @NamedInterface
- Checking the module structure with ApplicationModules.verify() and documenting it as PlantUML and C4 diagrams
- Hands-On: Define modules with Spring Modulith, uncover violations of module boundaries and generate the module documentation
Module interaction and tests in the modular monolith
- Interaction patterns compared: direct call, events, REST and messaging
- Events with ApplicationEventPublisher, @EventListener and @TransactionalEventListener
- Module integration tests with @ApplicationModuleTest
- Checking published events in a test
- Hands-On: Migrate a monolith with directly coupled packages for Course and Enrollment to Spring Modulith
From the modular monolith to microservices
- Monolith, modular monolith and microservices: trade-offs and decision criteria
- Choosing candidates for extraction and extracting modules step by step
- Inter-service communication over HTTP with RestClient and WebClient
- Database strategies: from a shared schema to a database per service
- In context: contract testing, distributed tracing and central configuration
- Hands-On: Extract Course and Enrollment as independent services and connect them over REST
Data and transactions in distributed systems
- Transactions with @Transactional and their limit when calling another service
- Two-phase commit and eventual consistency
- Saga pattern with choreography and orchestration
- CQRS in context
- Hands-On: Run and trace an orchestrated saga with compensation in a Spring Boot example with the Camunda workflow engine
Spring Cloud
- Overview of Spring Cloud: service discovery, gateway, central configuration and circuit breaker
- Spring Cloud Gateway with routes, predicates and filters
- Service discovery with Eureka as a demo
- Sessions across several instances with Spring Session and Redis
- Hands-On: Set up a Spring Cloud Gateway that routes requests to the Course Service and the Enrollment Service
Security and testing overview
- The Spring Security filter chain
- OAuth 2.0 and OpenID Connect, access token and ID token as JWT
- Services as OAuth2 resource servers with Keycloak as authorisation server
- Test pyramid, slice tests with @WebMvcTest and @DataJpaTest, integration tests with Testcontainers
- Hands-On: Configure the Course Service as an OAuth2 resource server and call it with an access token
At the end of the two days you have built the course management application as a monolith, as a modular monolith and as microservices with a gateway. You know the building blocks of Spring Boot, Spring Modulith and Spring Cloud from your own work and can justify the next architecture step for your application.
The actual course content may differ from the above depending on the trainer, delivery, duration and the composition of participants.
Request this course in-house
Request a public date
No suitable public date? Register without obligation — once there is enough interest we schedule a new public date and let you know first.
More about Spring Boot and Microservices
The Spring Framework was started in 2002 around Rod Johnson as a lightweight container with inversion of control and dependency injection. Spring Boot followed in 2014 with auto-configuration, starter dependencies and an embedded server. Since 2015 Spring Cloud has added building blocks for distributed systems such as service discovery, gateway, central configuration and circuit breakers. Spring Modulith, introduced in 2022 by Oliver Drotbohm, structures a Spring Boot application into modules whose boundaries are checked by a test.
A monolith, a modular monolith and microservices are stages of the same evolution. Modules with a clear public API and events between them can later be extracted as separate services when scaling, team structure or release cycles call for it.
Spring Boot 4 with Spring Framework 7 has been available since November 2025: Jackson 3, starters and auto-configuration split into modules, null safety with JSpecify, API versioning and Java 17 as the minimum with support up to Java 25. Virtual threads can be enabled with a property since Spring Boot 3.2 on Java 21. Open-source support for Spring Boot 3.5 ended in June 2026. Many applications still run on Spring Boot 3; the path to version 4 goes through the last 3.5 release.
Further resources:
Related courses
- Spring Modulith: the modular monolith in depth over two days.
- Spring Security: authentication and authorisation with OAuth 2.0, OpenID Connect and Keycloak.
- Clean Architecture with Spring Boot: structure and dependencies inside a Spring Boot application.
- Kotlin for Java Developers: introducing Kotlin in existing Java and Spring Boot applications.

