File tree Expand file tree Collapse file tree 5 files changed +30
-2
lines changed
spring-cloud-netflix-core
main/java/org/springframework/cloud/netflix/feign
test/java/org/springframework/cloud/netflix/feign/valid
spring-cloud-starter-feign Expand file tree Collapse file tree 5 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 2727 <main .basedir>${basedir} </main .basedir>
2828 <archaius .version>0.6.5</archaius .version>
2929 <eureka .version>1.2.5</eureka .version>
30- <feign .version>8.10 .0</feign .version>
30+ <feign .version>8.11 .0</feign .version>
3131 <hystrix .version>1.4.18</hystrix .version>
3232 <ribbon .version>2.1.0</ribbon .version>
3333 <servo .version>0.9.4</servo .version>
281281 <artifactId >feign-httpclient</artifactId >
282282 <version >${feign.version} </version >
283283 </dependency >
284+ <dependency >
285+ <groupId >com.netflix.feign</groupId >
286+ <artifactId >feign-hystrix</artifactId >
287+ <version >${feign.version} </version >
288+ </dependency >
284289 <dependency >
285290 <groupId >com.netflix.hystrix</groupId >
286291 <artifactId >hystrix-core</artifactId >
Original file line number Diff line number Diff line change 111111 <artifactId >feign-httpclient</artifactId >
112112 <optional >true</optional >
113113 </dependency >
114+ <dependency >
115+ <groupId >com.netflix.feign</groupId >
116+ <artifactId >feign-hystrix</artifactId >
117+ <optional >true</optional >
118+ </dependency >
114119 <dependency >
115120 <groupId >com.netflix.hystrix</groupId >
116121 <artifactId >hystrix-core</artifactId >
Original file line number Diff line number Diff line change 3939import feign .codec .Decoder ;
4040import feign .codec .Encoder ;
4141import feign .codec .ErrorDecoder ;
42+ import feign .hystrix .HystrixFeign ;
4243import feign .slf4j .Slf4jLogger ;
4344
4445/**
@@ -74,7 +75,7 @@ protected Feign.Builder feign(FeignClientFactory factory) {
7475 }
7576
7677 // @formatter:off
77- Feign .Builder builder = Feign .builder ()
78+ Feign .Builder builder = HystrixFeign .builder ()
7879 // required values
7980 .logger (logger )
8081 .encoder (get (factory , Encoder .class ))
Original file line number Diff line number Diff line change 5656import org .springframework .web .bind .annotation .RequestParam ;
5757import org .springframework .web .bind .annotation .RestController ;
5858
59+ import com .netflix .hystrix .HystrixCommand ;
5960import com .netflix .loadbalancer .Server ;
6061import com .netflix .loadbalancer .ServerList ;
6162
@@ -106,6 +107,9 @@ protected static interface TestClient {
106107
107108 @ RequestMapping (method = RequestMethod .GET , value = "/helloparams" )
108109 List <String > getParams (@ RequestParam ("params" ) List <String > params );
110+
111+ @ RequestMapping (method = RequestMethod .GET , value = "/hellos" )
112+ HystrixCommand <List <Hello >> getHellosHystrix ();
109113 }
110114
111115 @ FeignClient (serviceId = "localapp" )
@@ -246,6 +250,15 @@ public void testParams() {
246250 assertEquals ("params size was wrong" , list .size (), params .size ());
247251 }
248252
253+ @ Test
254+ public void testHystrixCommand () {
255+ HystrixCommand <List <Hello >> command = this .testClient .getHellosHystrix ();
256+ assertNotNull ("command was null" , command );
257+ List <Hello > hellos = command .execute ();
258+ assertNotNull ("hellos was null" , hellos );
259+ assertEquals ("hellos didn't match" , hellos , getHelloList ());
260+ }
261+
249262 @ Data
250263 @ AllArgsConstructor
251264 @ NoArgsConstructor
Original file line number Diff line number Diff line change 4444 <groupId >com.netflix.feign</groupId >
4545 <artifactId >feign-slf4j</artifactId >
4646 </dependency >
47+ <dependency >
48+ <groupId >com.netflix.feign</groupId >
49+ <artifactId >feign-hystrix</artifactId >
50+ </dependency >
4751 <dependency >
4852 <groupId >org.springframework.cloud</groupId >
4953 <artifactId >spring-cloud-starter-ribbon</artifactId >
You can’t perform that action at this time.
0 commit comments