Commit e4870c94 by Guillaume Berche Committed by Ryan Baxter

Refine Feign manual client doc (#2627)

parent 241468ab
...@@ -1192,15 +1192,17 @@ class FooController { ...@@ -1192,15 +1192,17 @@ class FooController {
@Autowired @Autowired
public FooController( public FooController(
Decoder decoder, Encoder encoder, Client client) { Decoder decoder, Encoder encoder, Client client, Contract contract) {
this.fooClient = Feign.builder().client(client) this.fooClient = Feign.builder().client(client)
.encoder(encoder) .encoder(encoder)
.decoder(decoder) .decoder(decoder)
.contract(contract)
.requestInterceptor(new BasicAuthRequestInterceptor("user", "user")) .requestInterceptor(new BasicAuthRequestInterceptor("user", "user"))
.target(FooClient.class, "http://PROD-SVC"); .target(FooClient.class, "http://PROD-SVC");
this.adminClient = Feign.builder().client(client) this.adminClient = Feign.builder().client(client)
.encoder(encoder) .encoder(encoder)
.decoder(decoder) .decoder(decoder)
.contract(contract)
.requestInterceptor(new BasicAuthRequestInterceptor("admin", "admin")) .requestInterceptor(new BasicAuthRequestInterceptor("admin", "admin"))
.target(FooClient.class, "http://PROD-SVC"); .target(FooClient.class, "http://PROD-SVC");
} }
...@@ -1212,6 +1214,10 @@ provided by Spring Cloud Netflix. ...@@ -1212,6 +1214,10 @@ provided by Spring Cloud Netflix.
NOTE: `PROD-SVC` is the name of the service the Clients will be making requests to. NOTE: `PROD-SVC` is the name of the service the Clients will be making requests to.
NOTE: The Feign `Contract` object defines what annotations and values are valid on interfaces. The
autowired `Contract` bean provides supports for SpringMVC annotations, instead of
the default Feign native annotations.
[[spring-cloud-feign-hystrix]] [[spring-cloud-feign-hystrix]]
=== Feign Hystrix Support === Feign Hystrix Support
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment