What is the purpose of the Kubernetes Deployment?
A Kubernetes Deployment declares the desired state of a stateless app and manages Pods through ReplicaSets, with rolling updates, rollbacks and scaling.
2,881 posts about Java: questions with answers, tutorials and articles, newest first.
A Kubernetes Deployment declares the desired state of a stateless app and manages Pods through ReplicaSets, with rolling updates, rollbacks and scaling.
Containerize a Spring Boot app, add Actuator liveness and readiness probes, and deploy it to Kubernetes with a Deployment, Service, ConfigMap and resource limits.
docker-compose.yml describes all services of an application in one file. See a Spring Boot and PostgreSQL example and Spring Boot 3.1 Docker Compose support.
The Dockerfile builds the container image for a Spring Boot app. Learn multi-stage builds, layered JARs and production settings.
@Scheduled runs a Spring bean method at fixed intervals or cron times. Learn how to enable it, which attributes to use and the pitfalls to avoid.
Run recurring jobs in Spring Boot with @Scheduled: fixedRate, fixedDelay, cron expressions, property-based schedules, thread pools and multi-instance locking.
@CacheEvict invalidates cached data in Spring when the source changes. Five practical scenarios, a test and the mistakes to avoid.
@CachePut always runs the method and stores its return value in the cache. Learn the key rules, conditions and pitfalls with a Spring Boot example.
Build an HttpGraphQlClient or HttpSyncGraphQlClient in Spring Boot, send GraphQL queries and mutations, map the response to Java types and handle errors.
Spring Boot auto-configures a CacheManager from your classpath. Learn the spring.cache properties and customizers for Caffeine, Redis and Ehcache 3.
Step-by-step Spring Boot caching: enable it, use @Cacheable, @CachePut and @CacheEvict, configure Caffeine with size and expiry, and avoid pitfalls.
Use @RestControllerAdvice, @ExceptionHandler and ProblemDetail to return consistent, safe error responses from a Spring Boot REST API.
Use RestClient for synchronous calls and WebClient for reactive ones. This guide shows GET, POST, PUT and DELETE, error handling, timeouts and moving off RestTemplate.
RestTemplate is Spring's blocking HTTP client for consuming REST APIs. Learn how to configure and use it, and why RestClient is now preferred.
Learn how to consume external APIs in Spring Boot using RestClient, WebClient and declarative HTTP interfaces, with timeouts, auth, error handling and tests.
@ResponseBody writes a return value to the response body, but file downloads also need headers. See the safe patterns for small, large and streamed files.
Learn how to return files from a Spring Boot controller with Content-Disposition, link them from a Thymeleaf template and block path traversal.
InputStreamResource adapts a one-shot InputStream to Spring's Resource type. See file download examples, the read-once rule and when to use other Resource classes.
Serve safe file downloads from a Spring Boot controller and link to them from Thymeleaf templates, with correct headers, 404 handling and path checks.
UserDetails is the Spring Security interface that describes a user: username, password hash, authorities and account flags. Learn how to implement it.