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
e2583f53
Commit
e2583f53
authored
Mar 06, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgrade Ribbon to version 2.0.0.
From 2.0.RC13 fixes gh-216
parent
df7abd1b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
24 deletions
+22
-24
pom.xml
pom.xml
+6
-1
pom.xml
spring-cloud-netflix-core/pom.xml
+5
-0
RibbonCommand.java
...ework/cloud/netflix/zuul/filters/route/RibbonCommand.java
+8
-8
RibbonRoutingFilter.java
...cloud/netflix/zuul/filters/route/RibbonRoutingFilter.java
+3
-15
No files found.
pom.xml
View file @
e2583f53
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<eureka.version>
1.1.147
</eureka.version>
<eureka.version>
1.1.147
</eureka.version>
<feign.version>
7.3.0
</feign.version>
<feign.version>
7.3.0
</feign.version>
<hystrix.version>
1.4.0
</hystrix.version>
<hystrix.version>
1.4.0
</hystrix.version>
<ribbon.version>
2.0
-RC13
</ribbon.version>
<ribbon.version>
2.0
.0
</ribbon.version>
<zuul.version>
1.0.28
</zuul.version>
<zuul.version>
1.0.28
</zuul.version>
<netflix.rxjava.version>
0.20.7
</netflix.rxjava.version>
<netflix.rxjava.version>
0.20.7
</netflix.rxjava.version>
<java.version>
1.7
</java.version>
<java.version>
1.7
</java.version>
...
@@ -239,6 +239,11 @@
...
@@ -239,6 +239,11 @@
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.netflix.ribbon
</groupId>
<artifactId>
ribbon-loadbalancer
</artifactId>
<version>
${ribbon.version}
</version>
</dependency>
<dependency>
<groupId>
com.netflix.rxjava
</groupId>
<groupId>
com.netflix.rxjava
</groupId>
<artifactId>
rxjava-core
</artifactId>
<artifactId>
rxjava-core
</artifactId>
<version>
${netflix.rxjava.version}
</version>
<version>
${netflix.rxjava.version}
</version>
...
...
spring-cloud-netflix-core/pom.xml
View file @
e2583f53
...
@@ -54,6 +54,11 @@
...
@@ -54,6 +54,11 @@
<artifactId>
eureka-core
</artifactId>
<artifactId>
eureka-core
</artifactId>
<optional>
true
</optional>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<groupId>
com.netflix.ribbon
</groupId>
<artifactId>
ribbon-loadbalancer
</artifactId>
<optional>
true
</optional>
</dependency>
<!-- Eureka core deps that are now optional -->
<!-- Eureka core deps that are now optional -->
<dependency>
<dependency>
<groupId>
com.thoughtworks.xstream
</groupId>
<groupId>
com.thoughtworks.xstream
</groupId>
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/route/RibbonCommand.java
View file @
e2583f53
...
@@ -21,8 +21,6 @@ import java.net.URI;
...
@@ -21,8 +21,6 @@ import java.net.URI;
import
java.net.URISyntaxException
;
import
java.net.URISyntaxException
;
import
java.util.List
;
import
java.util.List
;
import
javax.ws.rs.core.MultivaluedMap
;
import
com.netflix.client.http.HttpRequest
;
import
com.netflix.client.http.HttpRequest
;
import
com.netflix.client.http.HttpRequest.Builder
;
import
com.netflix.client.http.HttpRequest.Builder
;
import
com.netflix.client.http.HttpRequest.Verb
;
import
com.netflix.client.http.HttpRequest.Verb
;
...
@@ -37,6 +35,7 @@ import com.netflix.hystrix.HystrixCommandProperties.ExecutionIsolationStrategy;
...
@@ -37,6 +35,7 @@ import com.netflix.hystrix.HystrixCommandProperties.ExecutionIsolationStrategy;
import
com.netflix.niws.client.http.RestClient
;
import
com.netflix.niws.client.http.RestClient
;
import
com.netflix.zuul.constants.ZuulConstants
;
import
com.netflix.zuul.constants.ZuulConstants
;
import
com.netflix.zuul.context.RequestContext
;
import
com.netflix.zuul.context.RequestContext
;
import
org.springframework.util.MultiValueMap
;
/**
/**
* Hystrix wrapper around Eureka Ribbon command
* Hystrix wrapper around Eureka Ribbon command
...
@@ -45,6 +44,7 @@ import com.netflix.zuul.context.RequestContext;
...
@@ -45,6 +44,7 @@ import com.netflix.zuul.context.RequestContext;
* https://github.com/Netflix/zuul/blob/master/zuul-netflix/src/main/java/com/
* https://github.com/Netflix/zuul/blob/master/zuul-netflix/src/main/java/com/
* netflix/zuul/dependency/ribbon/hystrix/RibbonCommand.java
* netflix/zuul/dependency/ribbon/hystrix/RibbonCommand.java
*/
*/
@SuppressWarnings
(
"deprecation"
)
public
class
RibbonCommand
extends
HystrixCommand
<
HttpResponse
>
{
public
class
RibbonCommand
extends
HystrixCommand
<
HttpResponse
>
{
private
RestClient
restClient
;
private
RestClient
restClient
;
...
@@ -55,24 +55,24 @@ public class RibbonCommand extends HystrixCommand<HttpResponse> {
...
@@ -55,24 +55,24 @@ public class RibbonCommand extends HystrixCommand<HttpResponse> {
private
Boolean
retryable
;
private
Boolean
retryable
;
private
Multi
valued
Map
<
String
,
String
>
headers
;
private
Multi
Value
Map
<
String
,
String
>
headers
;
private
Multi
valued
Map
<
String
,
String
>
params
;
private
Multi
Value
Map
<
String
,
String
>
params
;
private
InputStream
requestEntity
;
private
InputStream
requestEntity
;
public
RibbonCommand
(
RestClient
restClient
,
Verb
verb
,
String
uri
,
public
RibbonCommand
(
RestClient
restClient
,
Verb
verb
,
String
uri
,
Boolean
retryable
,
Boolean
retryable
,
Multi
valued
Map
<
String
,
String
>
headers
,
Multi
Value
Map
<
String
,
String
>
headers
,
Multivalued
Map
<
String
,
String
>
params
,
InputStream
requestEntity
)
MultiValue
Map
<
String
,
String
>
params
,
InputStream
requestEntity
)
throws
URISyntaxException
{
throws
URISyntaxException
{
this
(
"default"
,
restClient
,
verb
,
uri
,
retryable
,
headers
,
params
,
requestEntity
);
this
(
"default"
,
restClient
,
verb
,
uri
,
retryable
,
headers
,
params
,
requestEntity
);
}
}
public
RibbonCommand
(
String
commandKey
,
RestClient
restClient
,
Verb
verb
,
String
uri
,
public
RibbonCommand
(
String
commandKey
,
RestClient
restClient
,
Verb
verb
,
String
uri
,
Boolean
retryable
,
Boolean
retryable
,
Multivalued
Map
<
String
,
String
>
headers
,
MultiValue
Map
<
String
,
String
>
headers
,
Multivalued
Map
<
String
,
String
>
params
,
InputStream
requestEntity
)
MultiValue
Map
<
String
,
String
>
params
,
InputStream
requestEntity
)
throws
URISyntaxException
{
throws
URISyntaxException
{
super
(
getSetter
(
commandKey
));
super
(
getSetter
(
commandKey
));
this
.
restClient
=
restClient
;
this
.
restClient
=
restClient
;
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/route/RibbonRoutingFilter.java
View file @
e2583f53
...
@@ -20,13 +20,11 @@ import java.io.IOException;
...
@@ -20,13 +20,11 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.ws.rs.core.MultivaluedMap
;
import
lombok.extern.apachecommons.CommonsLog
;
import
lombok.extern.apachecommons.CommonsLog
;
...
@@ -43,7 +41,6 @@ import com.netflix.niws.client.http.RestClient;
...
@@ -43,7 +41,6 @@ import com.netflix.niws.client.http.RestClient;
import
com.netflix.zuul.ZuulFilter
;
import
com.netflix.zuul.ZuulFilter
;
import
com.netflix.zuul.context.RequestContext
;
import
com.netflix.zuul.context.RequestContext
;
import
com.netflix.zuul.exception.ZuulException
;
import
com.netflix.zuul.exception.ZuulException
;
import
com.sun.jersey.core.util.MultivaluedMapImpl
;
@CommonsLog
@CommonsLog
public
class
RibbonRoutingFilter
extends
ZuulFilter
{
public
class
RibbonRoutingFilter
extends
ZuulFilter
{
...
@@ -125,7 +122,7 @@ public class RibbonRoutingFilter extends ZuulFilter {
...
@@ -125,7 +122,7 @@ public class RibbonRoutingFilter extends ZuulFilter {
Map
<
String
,
Object
>
info
=
this
.
helper
.
debug
(
verb
.
verb
(),
uri
,
headers
,
params
,
Map
<
String
,
Object
>
info
=
this
.
helper
.
debug
(
verb
.
verb
(),
uri
,
headers
,
params
,
requestEntity
);
requestEntity
);
RibbonCommand
command
=
new
RibbonCommand
(
service
,
restClient
,
verb
,
uri
,
retryable
,
RibbonCommand
command
=
new
RibbonCommand
(
service
,
restClient
,
verb
,
uri
,
retryable
,
convertHeaders
(
headers
),
convertHeaders
(
params
)
,
requestEntity
);
headers
,
params
,
requestEntity
);
try
{
try
{
HttpResponse
response
=
command
.
execute
();
HttpResponse
response
=
command
.
execute
();
this
.
helper
.
appendDebug
(
info
,
response
.
getStatus
(),
this
.
helper
.
appendDebug
(
info
,
response
.
getStatus
(),
...
@@ -150,18 +147,9 @@ public class RibbonRoutingFilter extends ZuulFilter {
...
@@ -150,18 +147,9 @@ public class RibbonRoutingFilter extends ZuulFilter {
private
MultiValueMap
<
String
,
String
>
revertHeaders
(
private
MultiValueMap
<
String
,
String
>
revertHeaders
(
Map
<
String
,
Collection
<
String
>>
headers
)
{
Map
<
String
,
Collection
<
String
>>
headers
)
{
MultiValueMap
<
String
,
String
>
map
=
new
LinkedMultiValueMap
<
String
,
String
>();
MultiValueMap
<
String
,
String
>
map
=
new
LinkedMultiValueMap
<>();
for
(
Entry
<
String
,
Collection
<
String
>>
entry
:
headers
.
entrySet
())
{
for
(
Entry
<
String
,
Collection
<
String
>>
entry
:
headers
.
entrySet
())
{
map
.
put
(
entry
.
getKey
(),
new
ArrayList
<
String
>(
entry
.
getValue
()));
map
.
put
(
entry
.
getKey
(),
new
ArrayList
<>(
entry
.
getValue
()));
}
return
map
;
}
private
MultivaluedMap
<
String
,
String
>
convertHeaders
(
MultiValueMap
<
String
,
String
>
headers
)
{
MultivaluedMap
<
String
,
String
>
map
=
new
MultivaluedMapImpl
();
for
(
Entry
<
String
,
List
<
String
>>
entry
:
headers
.
entrySet
())
{
map
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
map
;
return
map
;
}
}
...
...
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