Migrating from RestTemplate to RestClient in Spring Boot
Introduction
Since Spring Boot 3.2, RestTemplate has been deprecated in favor of the modern RestClient API. This migration guide explores why RestClient is the superior choice and demonstrates how to effectively replace RestTemplate in your existing codebase.
Why RestClient?
1. Modern Fluent API
RestClient provides a fluent, chainable API that significantly improves code readability:
Before (RestTemplate):
HttpEntity<RequestBody> entity = new HttpEntity<>(requestBody, headers);
ResponseEntity<ResponseObject[]> response = restTemplate.exchange(
url,
HttpMethod.POST,
entity,
ResponseObject[].class
);
ResponseObject[] data = response.getBody();
After (RestClient):
Kubernetes Tutorial Chapter 1: Local Cluster Setup with Docker Desktop on Windows WIP
Kubernetes Tutorial Chapter 1: Local Cluster Setup with Docker Desktop on Windows
Introduction
This is the first chapter in a series of tutorials on Kubernetes (K8s). This series will provide practical guidance on Kubernetes deployment and management, beginning with local development environments and progressing to more advanced configurations.
Prerequisites
- Windows 10 64-bit: Pro, Enterprise, or Education (Build 16299 or later)
- 4 GB RAM minimum (8 GB recommended)
- BIOS-level hardware virtualization support enabled
- 40 GB minimum free disk space
Docker Desktop Installation
-
Download and Install Docker Desktop
Kubernetes Tutorial Chapter 2: GitOps with ArgoCD WIP
Kubernetes Tutorial Chapter 2: GitOps with ArgoCD
Introduction
In the previous chapter, we set up a local Kubernetes cluster using Docker Desktop and deployed a simple React application using traditional imperative commands. While this approach works for learning and small-scale deployments, it doesn’t scale well for production environments where multiple team members need to collaborate on deployments, track changes, and maintain consistency across environments.
This is where GitOps comes in - a modern approach to managing Kubernetes deployments that leverages Git as the single source of truth for declarative infrastructure and applications.