Scrivio Interview library
ScenarioIntermediate6 min read · updated 12 November 2026

Your team uses Spring Cloud OpenFeign. Would you move to Spring HTTP interface clients, and what would you check before doing so?

I would consider it, because HTTP interface clients are part of Spring Framework itself and Spring Cloud OpenFeign's maintainers have described it as feature-complete, pointing new work towards Spring's own interface clients (check the project's current status). Before moving, I would list the Feign features we actually use, such as error decoders, retryers, request interceptors, load balancing, fallbacks and metrics, and confirm each has an equivalent on the RestClient behind the interface. Then I would migrate one client at a time, with contract tests proving the new client sends and handles exactly what the old one did.

Why this question is asked

Spring Cloud OpenFeign has been the default declarative client in Spring microservices for years, so most teams have dozens of @FeignClient interfaces. Since Spring Framework 6 shipped its own HTTP interface clients, the question of whether to move comes up in every upgrade planning meeting. Interviewers ask it because it tests migration judgement: knowing the new API is easy, but knowing what hidden behaviour the old library provided is what prevents an outage. In this answer, we will recap both approaches, look at why the move is attractive, compare features one by one, see a migrated client in code, and plan a safe migration.

1A Quick Recap of Feign and HTTP Interface Clients

Feign is a library, originally from Netflix and now community-maintained as OpenFeign, that creates an HTTP client from an annotated interface. Spring Cloud OpenFeign integrates it with Spring: we annotate an interface with @FeignClient(name = "inventory"), use Spring MVC annotations such as @GetMapping on its methods, and Spring creates the client. It brings its own extension points: an ErrorDecoder to turn error responses into exceptions, a Retryer, RequestInterceptor for headers, and integration with Spring Cloud LoadBalancer and Spring Cloud CircuitBreaker.

HTTP interface clients do the same job inside Spring Framework. We annotate an interface with @HttpExchange and @GetExchange, and HttpServiceProxyFactory creates a proxy backed by RestClient or WebClient. All the behaviour, such as timeouts, interceptors and error handling, lives on that underlying client rather than in a separate library.

2Why the Move Is Attractive

The first reason is dependencies. Feign clients need Spring Cloud, which has its own release train that must match the Spring Boot version. Every Boot upgrade then waits for a compatible Spring Cloud release. Interface clients come with Spring Framework, so they upgrade with it. Services that use Spring Cloud only for Feign can drop it entirely.

The second reason is the project's direction. The Spring Cloud OpenFeign team has said the project is feature-complete: it gets bug fixes and compatibility updates, but no big new features, and they suggest Spring's interface clients for new work. That can change, so we should check the project's current documentation before making a plan. But a library in that state is a reasonable thing to move away from gradually, before a Boot upgrade forces it.

The third reason is consistency. With interface clients, all outgoing calls go through RestClient, so timeouts, pool settings, observation and error handling are configured one way across the service.

3Comparing the Features We Actually Use

A migration fails when the old library did something useful that nobody wrote down. So before changing code, we search the codebase for every Feign extension point and list what each one does. Each has an equivalent, but on the RestClient, not on the interface.

Feign features and their RestClient equivalents
Feign featureWith HTTP interface clients
ErrorDecoderdefaultStatusHandler on RestClient.Builder
RequestInterceptorClientHttpRequestInterceptor via requestInterceptor()
RetryerSpring Framework 7 @Retryable, Spring Retry or Resilience4j
Load balancing by service name@LoadBalanced RestClient.Builder bean
Fallbacks (Spring Cloud CircuitBreaker)Resilience4j around the call, or in the caller
Micrometer metricsbuilt in: http.client.requests via Boot's builder
Per-client timeouts in propertiesrequest factory per client, or Boot 4 group properties
Check every row the codebase uses before migrating.

Two rows need extra care. Feign's default retryer configuration and its default timeouts differ from RestClient's, and services sometimes depend on them without knowing it. And Feign fallbacks through Spring Cloud CircuitBreaker have no built-in counterpart on an interface client, so we wrap the client call with Resilience4j ourselves or put the fallback in the calling service, where the business decision belongs anyway.

4A Migrated Client in Code

Here is a typical Feign client and its replacement. The annotations map almost one to one.

Java
// Before: Spring Cloud OpenFeign
@FeignClient(name = "inventory", configuration = InventoryFeignConfig.class)
interface InventoryClient {
@GetMapping("/stock/{sku}")
Stock stock(@PathVariable("sku") String sku);
}
// InventoryFeignConfig: ErrorDecoder 404 -> SkuNotFoundException, RequestInterceptor adds X-Tenant
// After: HTTP interface client on RestClient
@HttpExchange
interface InventoryClient {
@GetExchange("/stock/{sku}")
Stock stock(@PathVariable("sku") String sku);
}
@Bean
InventoryClient inventoryClient(@LoadBalanced RestClient.Builder builder, TenantInterceptor tenant) {
RestClient rc = builder.baseUrl("http://inventory") // logical name, resolved by LoadBalancer
.requestInterceptor(tenant) // was the Feign RequestInterceptor
.defaultStatusHandler(s -> s.value() == 404,
(req, res) -> { throw new SkuNotFoundException(); }) // was the ErrorDecoder
.build();
return HttpServiceProxyFactory.builderFor(RestClientAdapter.create(rc)).build()
.createClient(InventoryClient.class);
}
// inventoryClient.stock("A-1") -> Stock[sku=A-1, available=12]
// inventoryClient.stock("NOPE") -> throws SkuNotFoundException, as before

Notice that callers do not change at all if we keep the interface name and method signatures. Only the configuration moves, from Feign's configuration class to the RestClient builder. Also notice that the @LoadBalanced builder must be a separate bean from the plain RestClient.Builder used for external calls, because the qualifier decides which builder gets the load-balancing interceptor.

5Migrating One Client at a Time

We migrate client by client, starting with a simple, low-traffic one. Before touching it, we write contract tests against a stub server: the request the client sends (path, query, headers, body) and how it handles each response we care about, such as 200, 404, 500 and a timeout. We run those tests against the Feign client first, so they describe today's behaviour, and then against the new client. If both pass, the behaviour is identical in the cases that matter.

In production we watch the http.client.requests metrics for that dependency before and after the deploy: error rate, latency and retry counts should look the same. When the last Feign client is gone, we remove spring-cloud-starter-openfeign, and Spring Cloud entirely if nothing else uses it.

Step throughMigrating a Feign client safely
  1. List the Feign extension points it uses
  2. Write contract tests against a stubrun them on the Feign client first
  3. Build the interface client on RestClient
  4. Do the same contract tests pass?
    YesDeploy and compare metricsNoFind the missing behaviour
  5. Remove the Feign dependency after the last client

5 steps in order. Play them, or step through them one at a time.

6Follow-up questions

Is OpenFeign deprecated?

Not in the sense of being removed. Its maintainers have described Spring Cloud OpenFeign as feature-complete, which means bug fixes and compatibility work continue but large new features are unlikely. Its status can change, so I would read the current project page before using it as an argument. Either way, it is not an emergency; it is a reason to stop adding new Feign clients.

What about reactive services that use Feign?

Feign itself is blocking. A reactive service can use HTTP interface clients with a WebClientAdapter, and the methods then return Mono or Flux. That is often a better fit than the community reactive Feign libraries.

Would you migrate everything in one release?

No. A big-bang change of every client makes it hard to find which client changed behaviour when something goes wrong. One client per change, each with contract tests and a metric comparison, is slower on paper but much safer and still finishes in a few sprints.

7Conclusion

In this answer, we saw that HTTP interface clients do what Feign does but come with Spring Framework, so they remove the Spring Cloud dependency and its separate release train, and that Spring Cloud OpenFeign is described by its maintainers as feature-complete. Before moving, we list every Feign feature we use (error decoders, interceptors, retryers, load balancing, fallbacks, timeouts) and map each to the RestClient behind the interface. Then we migrate one client at a time, with contract tests run against both the old and the new client, and compare production metrics after each step.

What to say in the interviewAbout 80 seconds aloud

Open with

Yes, I would plan the move, but gradually. HTTP interface clients are part of Spring Framework, so we would drop the dependency on the Spring Cloud release train for this, and the OpenFeign maintainers have described the project as feature-complete and point to Spring's interface clients for new work; I would check the current status, but it is a good reason to stop writing new Feign clients.

Then, if they want more

Before migrating, I would list the Feign features we actually rely on, because those are where behaviour hides: error decoders, request interceptors, retryers, load balancing by service name, circuit breaker fallbacks, per-client timeouts and metrics.

Each has an equivalent on the RestClient behind the interface: defaultStatusHandler for the decoder, ClientHttpRequestInterceptor for headers, a @LoadBalanced builder for service names, Resilience4j or Spring 7's @Retryable for retries, and Micrometer observation is built in. Then I would migrate one client at a time.

For each, I would write contract tests against a stub server, run them on the Feign client first so they capture current behaviour, then on the new client, and after deploying compare error rates and latency for that dependency. When the last client is moved, we remove the OpenFeign starter.

About this answer

Last updated
12 November 2026
Versions it names
Spring Framework 6
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.
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 "Your team uses Spring Cloud OpenFeign. Would you move to Spring HTTP interface clients...": https://scrivio-interview-library.netlify.app/spring-boot/http-clients/78906c2aef/