Packing Spring Boot into Lightweight Docker Images
Using multi-stage builds, layered jars, minimal JRE, and non-root users to create small, fast-building, and secure Spring Boot Docker images.
Using multi-stage builds, layered jars, minimal JRE, and non-root users to create small, fast-building, and secure Spring Boot Docker images.
Guide to using Spring Kafka to send messages with KafkaTemplate, receive with @KafkaListener, handle errors with Dead Letter Topic, and write tests with Embedded Kafka.
Use Pageable, Page, Slice, and Sort from Spring Data JPA for pagination and sorting data, from repository to REST controller, with tests and common pitfalls.
How @Transactional works through proxy, along with common pitfalls like self-invocation, checked exception, rollback-only, and tests that hide errors.
How to use @Scheduled with fixedRate, fixedDelay and cron, configure thread pools, handle errors, write tests, and avoid common pitfalls with scheduled tasks.
Write integration tests running on real PostgreSQL using Testcontainers and @ServiceConnection, share containers between test classes, and avoid common pitfalls.
Guide to using @Cacheable, @CachePut, @CacheEvict with Redis in Spring Boot 3, configuring TTL, JSON serializer, and writing tests with Testcontainers.
Manage database schema with Flyway in Spring Boot 3. This article covers how to write SQL and Java migrations, configuration, testing, and handling common errors.
Configure Spring Security with JWT for REST API: issue tokens at login, stateless authentication, role-based authorization, and write tests with MockMvc.
Separate configuration and beans by environment (dev, test, prod) using Spring Profiles, activate profiles in multiple ways, write tests with @ActiveProfiles, and avoid common pitfalls.
Guide to using RestClient for HTTP API calls: GET/POST, error handling, timeouts, interceptors, HTTP interfaces, and testing with MockRestServiceServer.
Configure Spring Boot Actuator for health checks, liveness/readiness probes, and metrics with Micrometer, including export to Prometheus.
Group configuration into a typed record with @ConfigurationProperties. This guide covers binding complex types, startup validation, IDE metadata, and testing.
How to use @WebMvcTest, MockMvc, and @MockitoBean to quickly test REST controllers, loading only the web layer, checking JSON, validation, and exception handling.
Guide to using @ControllerAdvice and @ExceptionHandler for centralized error handling, returning standardized responses instead of scattered try-catch blocks across controllers.
Learn how Spring Data JPA auto-generates repositories, naming conventions for query methods, and when to use @Query for precise control over statements.
Step-by-step guide to building a REST API for managing Orders with Spring Boot, from project initialization to writing controller tests.
Guide to using Bean Validation in Spring Boot to validate input data, create custom validators, and handle validation errors elegantly for clients.