OpenFeign / OpenFeign/feign

Support for multiple feign.Client beans within Spring

Open
#1,798 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

Hi,

I have a service that has 2 clients

  • one that needs to make REST requests using a proxy
  • one that needs to make REST request without a proxy

Is it possible to use different configuration files to support this, I have tried something like this

Configuration class X

@Bean
public Client client1() {
return new Client.Default(null, null);
}

Configuration class Y

@Bean
public Client client2() {
return new Client.Proxied(null, null,
new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.0.0.1", 8080)));
}

It seems only one of the beans is used when making requests.

Any help is appreciated,
Paul.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by tracing how Spring configuration selects Feign Client beans, then determine how two Feign clients could retain separate proxy and non-proxy behavior. Done means distinct clients can make requests through their respective configurations without one bean replacing the other.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.