
foojay · 6 min readBackend & APIs
You Can Delete Feign Now: Spring Boot 4's Built-in HTTP Clients
Spring Boot 4 introduces built‑in HTTP interface clients that replace OpenFeign and RestTemplate. By defining an annotated interface, configuring a service client group, and injecting the bean, developers can call remote APIs with minimal setup and handle errors, timeouts, and headers directly.
- Add spring-boot-starter-restclient and annotate interfaces with @HttpExchange
- Configure groups under spring.http.serviceclient for base URL, timeouts, and default headers
- Replace @FeignClient with @HttpExchange and migrate gradually, removing OpenFeign dependencies