advancedSpring Security

What is @HttpExchange in Spring Boot 3? How does it replace Feign?

@HttpExchange is Spring's own declarative HTTP client — define an interface with @GetExchange/@PostExchange annotations, register it via HttpServiceProxyFactory backed by WebClient or RestClient. Similar convenience to OpenFeign, but built into core Spring Framework with no extra dependency, and integrates natively with observability and virtual threads.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What is RestClient (Spring Boot 3.2)? How does it differ from RestTemplate and WebClient?← Back to all Spring Boot & Microservices questions