Quick revision
The short answer
Spring Framework 6 added HTTP interfaces: we annotate an interface with @HttpExchange and methods with @GetExchange or @PostExchange, and a proxy backed by RestClient or WebClient implements it, much like Feign but built into the framework. Spring Framework 7 adds support for registering groups of such clients with shared configuration, so check your version. I would not rush to migrate working Feign clients: I would migrate when I touch a client anyway or need RestClient features, map Feign's error decoders, interceptors and load balancing to their RestClient equivalents, and keep one style per codebase.
What to remember
In this answer, we saw that Spring Cloud OpenFeign is maintained but feature complete, and that Spring Framework 6 HTTP interfaces with @HttpExchange and @GetExchange provide the same declarative style backed by RestClient or WebClient, with Spring Framework 7 adding grouped registration of clients. We mapped Feign's error decoders, interceptors, load balancing and timeouts to RestClient equivalents, and decided to migrate only when a client changes anyway or needs new features, keeping one style per codebase.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Spring Framework 6 added HTTP interfaces: we annotate an interface with @HttpExchange and methods with @GetExchange or @PostExchange, and a proxy backed by RestClient or WebClient implements it, much like Feign but built into the framework. Spring Framework 7 adds support for registering groups of such clients with shared configuration, so check your version. I would not rush to migrate working Feign clients: I would migrate when I touch a client anyway or need RestClient features, map Feign's error decoders, interceptors and load balancing to their RestClient equivalents, and keep one style per codebase.
Why this question is asked
When a library everyone depends on is declared feature complete, teams start asking whether they must rewrite their clients. Spring Cloud OpenFeign is in that state: it still gets bug fixes and compatibility updates, but no new features, and the Spring team points new work to HTTP interfaces in the core framework. Interviewers ask this to see whether we know the alternative and can make a measured migration decision instead of a panicked one. In this answer, we will recap what feature complete means, write the same client in both styles, map Feign features to their new homes, look at client groups in Spring Framework 7, and then decide when to migrate.
1What Feature Complete Means for OpenFeign
Feature complete means the project is maintained but no longer growing. The Spring Cloud team keeps Spring Cloud OpenFeign compatible with new Spring Boot versions and fixes bugs and security issues, but it does not plan new features, and the recommended direction is the declarative HTTP interface support in Spring Framework itself.
So nothing breaks today. The practical effect is that new capabilities, such as better observation support or new client features in RestClient, arrive in the framework's clients first, and Feign may never get them. That is a reason to prefer the new style for new code, not a reason to rewrite everything at once.
2The Same Client, Two Ways
Here is a customer lookup written as a Feign client and as an HTTP interface. The interface style uses its own annotations, and a factory creates the proxy, an object generated at runtime that turns each method call into an HTTP request.
Notice that the HTTP interface is backed by a client we build ourselves, a RestClient here or a WebClient for reactive code. Everything RestClient can do, such as timeouts through its request factory, interceptors, status handlers and observation, applies to the interface automatically. That is the main advantage: there is one HTTP client stack to configure and learn, not a separate Feign stack.
3Mapping Feign Features to RestClient
Most Feign features have a direct equivalent, but they live in different places, so a migration needs a mapping rather than a search and replace. The table shows the common ones.
| Feign | With an HTTP interface |
|---|---|
ErrorDecoder | defaultStatusHandler on RestClient.Builder |
RequestInterceptor (auth header) | ClientHttpRequestInterceptor on the builder |
| name = "customers" (load balancing) | @LoadBalanced RestClient.Builder |
client.config.<name>.read-timeout | timeouts on the request factory or Boot's client settings |
| Retryer, circuit breaker integration | Spring Retry, Resilience4j or framework resilience features |
| fallback class | a circuit breaker fallback around the client |
One difference deserves attention: errors. A Feign ErrorDecoder produces an exception from a response. With RestClient, defaultStatusHandler on the builder does the same, for example turning a 404 into CustomerNotFoundException. If we skip this step, the new client throws RestClient's own HttpClientErrorException types, and callers that catch our old exceptions silently stop working.
4Client Groups in Spring Framework 7
Creating each client with a factory bean, as above, gets repetitive with many clients. Spring Framework 7 adds support for registering HTTP service clients in groups: we declare which interfaces belong to a group, for example everything that talks to the customers service, and they share one configured RestClient with its base URL, timeouts and interceptors. Spring Boot 4 builds on this with auto-configuration and properties per group.
The exact annotation and property names are new, so check your version's reference documentation before relying on them. The idea is what matters in an interview: Framework 7 removes the boilerplate that made Feign's @EnableFeignClients attractive in the first place.
5Deciding Whether and When to Migrate
A working Feign client is not technical debt just because a newer style exists. Rewriting it costs time and carries the risk of subtle behaviour changes, mainly around errors and timeouts. So I would use simple triggers. New clients use HTTP interfaces. An existing client migrates when we change it anyway, for example to add endpoints, or when we need a RestClient feature Feign lacks. Clients nobody touches stay as they are until a Spring Boot upgrade makes Feign a blocker, which today it is not.
Within one codebase, I would keep one style per service where possible, or at least one style per dependency, so a reader does not find a Feign client and an HTTP interface for the same customers service. When a migration happens, contract tests or stub tests that check the request and the error mapping protect us from the subtle differences.
- Is it a new client?YesUse an HTTP interfaceNoLook at the existing client
- Are we changing it anyway?YesMigrate it with stub testsNoIs a needed feature missing?
- Need a RestClient feature Feign lacks?YesMigrate it with stub testsNoLeave it on Feign for now
3 steps in order. Play them, or step through them one at a time.
Migration follows real change, not a calendar.
6Follow-up questions
Is OpenFeign going to be removed?
There is no announced removal. Feature complete means maintenance continues, with compatibility and bug fixes, while new features go to the framework's HTTP interfaces. We should watch the Spring Cloud release notes for each train, but there is no need to plan an emergency migration.
Can an HTTP interface be reactive?
Yes. Backed by a WebClient through WebClientAdapter, methods can return Mono or Flux, which Feign never supported well. Backed by RestClient, methods return plain values and block, which suits most Spring MVC services.
How do you migrate safely?
Write stub tests for the existing Feign client first, covering the success response, a 404, a 500 and a timeout, then switch the implementation behind the same tests. If the tests pass with the new client, the callers see the same behaviour.
7Conclusion
In this answer, we saw that Spring Cloud OpenFeign is maintained but feature complete, and that Spring Framework 6 HTTP interfaces with @HttpExchange and @GetExchange provide the same declarative style backed by RestClient or WebClient, with Spring Framework 7 adding grouped registration of clients. We mapped Feign's error decoders, interceptors, load balancing and timeouts to RestClient equivalents, and decided to migrate only when a client changes anyway or needs new features, keeping one style per codebase.
Open with
Spring Cloud OpenFeign is feature complete, which means it is maintained and kept compatible but gets no new features. The alternative is built into Spring Framework since version 6: HTTP interfaces.
Then, if they want more
I write an interface with @HttpExchange at the type level and @GetExchange or @PostExchange on methods, and HttpServiceProxyFactory creates a proxy backed by a RestClient or WebClient through an adapter. The benefit is one HTTP client stack: timeouts, interceptors, status handlers, observation and load balancing all come from the RestClient I configure, for example from a @LoadBalanced RestClient.Builder.
Spring Framework 7 adds registration of groups of HTTP service clients with shared configuration, and Boot 4 auto-configures them, though I would check the exact annotations for the version. On migration, I see no urgency for clients that work. New clients use HTTP interfaces; existing Feign clients migrate when we are changing them anyway or need a RestClient feature.
When migrating, I map the Feign features explicitly: ErrorDecoder becomes defaultStatusHandler, RequestInterceptor becomes a ClientHttpRequestInterceptor, Feign's per-client timeouts go to the request factory, and retries or circuit breakers move to Resilience4j or Spring Retry. The error mapping is the easiest to forget, so I would cover it with stub tests before and after.
And I would keep one style per codebase, so nobody finds two kinds of clients for the same service.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Spring Framework 7, Spring Framework 6, Spring Boot 4
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Cloud documentation, Resilience4j documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Spring Cloud OpenFeign is considered feature complete. What alternatives does Spring...": https://scrivio-interview-library.netlify.app/spring-boot/spring-cloud/8ef16c2e40/