Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
6d559102
Commit
6d559102
authored
Oct 19, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade feign to 8.11.0
Adds support for feign-hystrix fixes gh-606
parent
9e4cad75
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
2 deletions
+30
-2
pom.xml
pom.xml
+6
-1
pom.xml
spring-cloud-netflix-core/pom.xml
+5
-0
FeignClientFactoryBean.java
...framework/cloud/netflix/feign/FeignClientFactoryBean.java
+2
-1
FeignClientTests.java
...framework/cloud/netflix/feign/valid/FeignClientTests.java
+13
-0
pom.xml
spring-cloud-starter-feign/pom.xml
+4
-0
No files found.
pom.xml
View file @
6d559102
...
...
@@ -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.1
0
.0
</feign.version>
<feign.version>
8.1
1
.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>
...
...
spring-cloud-netflix-core/pom.xml
View file @
6d559102
...
...
@@ -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>
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientFactoryBean.java
View file @
6d559102
...
...
@@ -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
=
Hystrix
Feign
.
builder
()
// required values
.
logger
(
logger
)
.
encoder
(
get
(
factory
,
Encoder
.
class
))
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/valid/FeignClientTests.java
View file @
6d559102
...
...
@@ -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
...
...
spring-cloud-starter-feign/pom.xml
View file @
6d559102
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment