Support for multiple feign.Client beans within Spring
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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