Quick revision
The short answer
Yes, I would standardise, because four client stacks mean four ways to configure timeouts, retries, tracing and authentication, and four sets of bugs. For blocking services, RestClient with HTTP interface clients covers what Feign and RestTemplate did, with first-party Spring support; WebClient stays where code is already reactive. I would deliver it as a company starter with observability, timeout and auth defaults, migrate on touch rather than in a big bang, and stop new usage of the options on their way out.
What to remember
In this answer, we decided to standardise HTTP clients across an organisation that uses Feign, RestTemplate, WebClient and RestClient. Standardising removes duplicated configuration for timeouts, retries, tracing and auth. RestClient with HTTP interface clients covers what Feign and RestTemplate did, with first-party support, while WebClient stays in reactive code. A company starter provides observability, timeout and auth defaults, migration happens on touch rather than in a big bang, and ArchUnit rules and a usage dashboard stop new usage of the deprecated options.
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.
Yes, I would standardise, because four client stacks mean four ways to configure timeouts, retries, tracing and authentication, and four sets of bugs. For blocking services, RestClient with HTTP interface clients covers what Feign and RestTemplate did, with first-party Spring support; WebClient stays where code is already reactive. I would deliver it as a company starter with observability, timeout and auth defaults, migrate on touch rather than in a big bang, and stop new usage of the options on their way out.
Why this question is asked
Large organisations collect HTTP clients the way old houses collect light switches: each one made sense when it was added. Feign came with Spring Cloud, RestTemplate was the default for years, WebClient arrived with reactive work, and RestClient is the newest. The cost shows up in incidents, when one team's client has no timeout, and in audits, when nobody can say how tokens are handled across services. Interviewers ask this at senior level to see whether we can choose a standard and roll it out without stopping the business. In this answer, we will look at the cost of four stacks, choose the standard for blocking and reactive services, design the company starter, plan the migration, and see how to keep the standard in place.
1What Four Client Stacks Cost
Every outbound HTTP call needs the same cross-cutting behaviour: connect and read timeouts, a bounded connection pool, retries for safe requests, tracing and metrics, authentication, and logging that never prints secrets. With Feign, RestTemplate, WebClient and RestClient in use, each of these is configured in four different ways, often by each team separately.
The result is predictable. Some services have no read timeout because their stack's default had none. Trace ids propagate through three stacks but not the fourth. A security fix in token handling must be made four times. And engineers moving between teams must learn a different client each time. None of this is a crisis on its own, but together it is a steady tax and a source of incidents.
2Choosing the Standard
For blocking services, which is most Spring MVC code, RestClient with HTTP interface clients is the natural choice today. RestClient is Spring's current synchronous client, built on the same request factories, converters and interceptors as RestTemplate, so migration is cheap. HTTP interfaces give the declarative style that made Feign popular, an annotated Java interface implemented at runtime, but as part of Spring Framework itself, maintained with it and without the extra Spring Cloud dependency. Spring Cloud OpenFeign itself has been described by its maintainers as feature-complete and in maintenance mode, which makes the case stronger; check the current status before quoting it.
For reactive services built on WebFlux, WebClient stays. Forcing reactive code onto a blocking client would be a step backwards, and HTTP interfaces work on top of WebClient too, so the declarative style can still be shared. So the standard is one declarative style everywhere, with RestClient underneath for blocking code and WebClient for reactive code.
| Today | Where it is used | Standard |
|---|---|---|
RestTemplate | Older blocking services | RestClient, via RestClient.builder(restTemplate) |
| Feign | Spring Cloud services | HTTP interface on RestClient |
WebClient with block() | Blocking services that wanted a fluent API | RestClient |
| WebClient, reactive | WebFlux services | Stays; HTTP interface on WebClient optional |
RestClient | Newer services | Already standard; move config to the starter |
3A Company Starter With Safe Defaults
A standard that each team must configure by hand will be configured differently by each team. So the standard ships as a Spring Boot starter. Adding it gives a service RestClient and WebClient builders with observability wired in, sensible default timeouts that are always set, a pooled request factory, a correlation-id interceptor, a redacting logging interceptor, and OAuth2 client-credentials support configured from properties.
Notice that the team writes only what is specific to its dependency. The property names here are our starter's own; recent Spring Framework versions add built-in support for registering groups of HTTP interface clients, and the starter can build on that where available, so check your version. The starter is versioned and owned by a platform team, and a fix to token handling or a better default timeout reaches every service with a dependency bump.
4Migrating on Touch, Not in a Big Bang
Rewriting every client in every service at once would stop feature work and concentrate risk. Instead, the rule is migrate on touch: when a team changes code that calls a downstream service, it moves that client to the standard in the same piece of work. New services use the standard from day one.
For RestTemplate, the bridge is RestClient.builder(restTemplate), which reuses the existing configuration while call sites move. For Feign, the move is mostly mechanical: Feign interfaces and HTTP interfaces look alike, with @GetExchange in place of @GetMapping-style annotations. Each migrated client gets tests for its success and error paths, because error handling differs between stacks. A small number of focused sprints at the end cover modules nobody touches.
- Build and pilot the startertwo or three teams, fix the rough edges
- New services use the starterfrom the first commit
- Migrate on toucha client moves when its code is changed anyway
- Block new usage of old stacksArchUnit rules, review checklist
- Clean-up sprintsfor modules nobody touches
- Remove old stackswhen the usage dashboard shows zero
6 steps in order. Play them, or step through them one at a time.
5Keeping the Standard in Place
Two guardrails stop the organisation drifting back. First, new usage of the deprecated options is blocked: an ArchUnit rule, frozen for existing code, fails the build when new code uses RestTemplate or Feign, and the code review checklist says the same for anything a rule cannot see. Second, visibility: a dashboard built from dependency scans shows, per service, which client stacks are still in use, so leaders can see progress and teams can see what is left.
Exceptions are allowed, but explicit. A team with a special need, for example a client for a protocol the standard does not cover, writes down why and keeps it isolated behind its own interface. The goal is not uniformity for its own sake, but one well-configured default that everyone gets for free.
6Follow-up questions
Why not standardise on WebClient everywhere, since it works for both?
Because in blocking services it means calling block() on every request and carrying Reactor and a second programming model for no benefit. With RestClient available, and virtual threads making blocking cheap, WebClient's strengths matter only in reactive services.
What if a team depends on a Feign feature, such as a custom encoder?
Most Feign extension points have equivalents: message converters for encoders and decoders, interceptors for request customisation, status handlers for error decoding. Where something is missing, the team keeps Feign for that client behind its interface until the starter offers an alternative, and the exception is recorded.
7Conclusion
In this answer, we decided to standardise HTTP clients across an organisation that uses Feign, RestTemplate, WebClient and RestClient. Standardising removes duplicated configuration for timeouts, retries, tracing and auth. RestClient with HTTP interface clients covers what Feign and RestTemplate did, with first-party support, while WebClient stays in reactive code. A company starter provides observability, timeout and auth defaults, migration happens on touch rather than in a big bang, and ArchUnit rules and a usage dashboard stop new usage of the deprecated options.
Open with
Yes, I would standardise, mainly because of the cross-cutting concerns. Every outbound call needs timeouts, a bounded pool, safe retries, tracing, auth and redacted logging, and with four stacks we configure each of those four ways, which in practice means some services have no timeouts and some lose trace ids.
Then, if they want more
For blocking services, which is most of our code, I would pick RestClient with HTTP interface clients. HTTP interfaces give the declarative style teams like in Feign, but as part of Spring Framework, and RestClient shares RestTemplate's request factories and interceptors, so migrating is cheap; Feign itself is in maintenance mode as far as I know, which I would double-check.
WebClient stays in services that are genuinely reactive. I would ship it as a company starter owned by a platform team: builders with observability, default timeouts that are always set, pooled factories, correlation ids, redacting logs and OAuth2 client credentials from properties, so a team only declares the interface and a base URL.
Migration happens on touch, with RestClient.builder(restTemplate) as the bridge and tests for error paths, plus a few clean-up sprints at the end. And I stop new usage with frozen ArchUnit rules and track remaining usage on a dashboard, allowing documented exceptions behind their own interfaces.
About this answer
- Last updated
- 12 November 2026
- 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 Framework reference, Spring Web MVC
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 organisation uses Feign, RestTemplate, WebClient and RestClient across services....": https://scrivio-interview-library.netlify.app/spring-boot/http-clients/c102255392/