Commit 2c8bac56 by Ryan Baxter

Use client interface instead of Eureka directly

parent cc24d00f
......@@ -989,18 +989,17 @@ class FooController {
@Autowired
public FooController(
ResponseEntityDecoder decoder, SpringEncoder encoder, EurekaClient discoveryClient) {
InstanceInfo prodSvcInfo = discoveryClient.getNextServerFromEureka("PROD-SVC", false);
this.fooClient = Feign.builder()
ResponseEntityDecoder decoder, SpringEncoder encoder, Client client) {
this.fooClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.requestInterceptor(new BasicAuthRequestInterceptor("user", "user"))
.target(FooClient.class, prodSvcInfo.getHomePageUrl());
this.adminClient = Feign.builder()
.decoder(decoder)
.requestInterceptor(new BasicAuthRequestInterceptor("user", "user"))
.target(FooClient.class, "http://PROD-SVC");
this.adminClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.requestInterceptor(new BasicAuthRequestInterceptor("admin", "admin"))
.target(FooClient.class, prodSvcInfo.getHomePageUrl());
.decoder(decoder)
.requestInterceptor(new BasicAuthRequestInterceptor("admin", "admin"))
.target(FooClient.class, "http://PROD-SVC");
}
}
----
......
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