Commit 6d559102 by Spencer Gibb

Upgrade feign to 8.11.0

Adds support for feign-hystrix fixes gh-606
parent 9e4cad75
......@@ -27,7 +27,7 @@
<main.basedir>${basedir}</main.basedir>
<archaius.version>0.6.5</archaius.version>
<eureka.version>1.2.5</eureka.version>
<feign.version>8.10.0</feign.version>
<feign.version>8.11.0</feign.version>
<hystrix.version>1.4.18</hystrix.version>
<ribbon.version>2.1.0</ribbon.version>
<servo.version>0.9.4</servo.version>
......@@ -282,6 +282,11 @@
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>com.netflix.feign</groupId>
<artifactId>feign-hystrix</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<version>${hystrix.version}</version>
......
......@@ -112,6 +112,11 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.netflix.feign</groupId>
<artifactId>feign-hystrix</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<optional>true</optional>
......
......@@ -39,6 +39,7 @@ import feign.Retryer;
import feign.codec.Decoder;
import feign.codec.Encoder;
import feign.codec.ErrorDecoder;
import feign.hystrix.HystrixFeign;
import feign.slf4j.Slf4jLogger;
/**
......@@ -74,7 +75,7 @@ class FeignClientFactoryBean implements FactoryBean<Object>, InitializingBean, A
}
// @formatter:off
Feign.Builder builder = Feign.builder()
Feign.Builder builder = HystrixFeign.builder()
// required values
.logger(logger)
.encoder(get(factory, Encoder.class))
......
......@@ -56,6 +56,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.netflix.hystrix.HystrixCommand;
import com.netflix.loadbalancer.Server;
import com.netflix.loadbalancer.ServerList;
......@@ -106,6 +107,9 @@ public class FeignClientTests {
@RequestMapping(method = RequestMethod.GET, value = "/helloparams")
List<String> getParams(@RequestParam("params") List<String> params);
@RequestMapping(method = RequestMethod.GET, value = "/hellos")
HystrixCommand<List<Hello>> getHellosHystrix();
}
@FeignClient(serviceId = "localapp")
......@@ -246,6 +250,15 @@ public class FeignClientTests {
assertEquals("params size was wrong", list.size(), params.size());
}
@Test
public void testHystrixCommand() {
HystrixCommand<List<Hello>> command = this.testClient.getHellosHystrix();
assertNotNull("command was null", command);
List<Hello> hellos = command.execute();
assertNotNull("hellos was null", hellos);
assertEquals("hellos didn't match", hellos, getHelloList());
}
@Data
@AllArgsConstructor
@NoArgsConstructor
......
......@@ -45,6 +45,10 @@
<artifactId>feign-slf4j</artifactId>
</dependency>
<dependency>
<groupId>com.netflix.feign</groupId>
<artifactId>feign-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-ribbon</artifactId>
</dependency>
......
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