Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multiple Clients Using The Same Service #90

Merged
merged 6 commits into from Jan 7, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

Add contextId example to documentation

  • Loading branch information
Ph0ndragX committed Dec 18, 2018
commit 82fa5181fdd2e23e7414521f468ecea88e17d157
@@ -212,6 +212,27 @@ hystrix:
strategy: SEMAPHORE
----

If we want to create multiple feign clients with the same name or url
so that they would point to the same server but each with a different custom configuration then
we have to use `contextId` attribute of the `@FeignClient` in order to avoid name
collision of these configuration beans.

[source,java,indent=0]
----
@FeignClient(contextId = "fooClient", name = "stores", configuration = FooConfiguration.class)
public interface FooClient {
//..
}
----

[source,java,indent=0]
----
@FeignClient(contextId = "barClient", name = "stores", configuration = BarConfiguration.class)
public interface BarClient {
//..
}
----

=== Creating Feign Clients Manually

In some cases it might be necessary to customize your Feign Clients in a way that is not
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.