跪拜 Guibai
← All articles
Backend

Spring Framework 6 Ships a Native Declarative HTTP Client That Outperforms Feign by 40%

By 苏三说技术 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Teams that adopt @HttpExchange shed a Spring Cloud dependency, gain native reactive support, and get a 40% throughput improvement at high concurrency without changing their annotation-driven programming model. For greenfield services or WebFlux stacks, it removes the friction of bolting a blocking client onto a reactive runtime.

Summary

@HttpExchange is a Spring Framework 6 core feature that provides declarative HTTP clients through annotated interfaces, backed by RestClient or WebClient. Unlike Feign, it requires no Spring Cloud starter, no @EnableFeignClients annotation, and automatically selects synchronous or asynchronous execution based on the method's return type. Under 1000 concurrent requests, measured throughput is roughly 40% higher than OpenFeign, with memory consumption down about 35%.

Feign remains a blocking-only proxy built on JDK dynamic proxies and tied to the Spring Cloud release cycle. @HttpExchange separates interface definition from transport, using an adapter pattern that routes calls to RestClient for plain return types and WebClient for CompletableFuture, Mono, or Flux. Spring Framework 7 will add an HTTP Service Registry to reduce the boilerplate of manually creating HttpServiceProxyFactory instances.

Migration makes sense for new projects, teams adopting WebFlux, or anyone who wants a lighter dependency footprint. Existing Spring Cloud projects with many Feign interfaces can stay put; the two can coexist while new endpoints move to @HttpExchange gradually.

Takeaways
@HttpExchange is part of Spring Framework 6 core; it needs no spring-cloud-starter-openfeign or @EnableFeignClients.
Method return types drive execution: plain types use synchronous RestClient; CompletableFuture, Mono, or Flux use asynchronous WebClient.
Benchmarks show ~40% higher throughput and ~35% lower memory consumption than OpenFeign at 1000 concurrent requests.
Feign is blocking-only and tied to the Spring Cloud release cadence; @HttpExchange decouples interface definition from the HTTP engine.
Spring Framework 7 will introduce an HTTP Service Registry and @ImportHttpServices to cut configuration boilerplate.
Spring Cloud 2026.0 adds native load-balancing support for @HttpExchange, closing a previous gap with Feign.
Migration can be gradual: new interfaces use @HttpExchange, low-frequency Feign interfaces move next, and core interfaces shift last.
Conclusions

Spring is absorbing a capability that was previously outsourced to the Cloud portfolio into the core Framework, which signals that declarative HTTP is now considered a fundamental primitive, not a microservice-specific concern.

The adapter pattern underneath @HttpExchange means the same interface definition can flip between blocking and reactive transports just by changing the return type, a design that Feign's hard-wired proxy cannot replicate without a rewrite.

Performance gains come from removing the Netflix/Spring Cloud abstraction layer and letting the Framework's own RestClient/WebClient handle the call stack directly, which also simplifies debugging and stack traces.

Feign's dominance was partly accidental — it was the only mature option in the ecosystem for years. @HttpExchange shows that the bar for a built-in solution is now higher: it must serve both servlet and reactive stacks equally well.

Concepts & terms
HttpServiceProxyFactory
A Spring Framework 6 factory that creates dynamic proxies for HTTP interface definitions, routing calls to RestClient (sync) or WebClient (reactive) based on the method's return type.
RestClientAdapter
An adapter that wraps a Spring RestClient so it can be used as the underlying transport inside an HttpServiceProxyFactory.
HTTP Service Registry
A planned Spring Framework 7 feature that registers HTTP interface proxies centrally, removing the need to manually instantiate HttpServiceProxyFactory for each client.
From the discussion

The discussion is thin. One comment asks for compatibility with existing Spring MVC annotations, while another simply notes a plan to try the new client in a monolith project, having previously relied on Feign.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗