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
dfaad78d
Commit
dfaad78d
authored
Nov 24, 2014
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update versions of netflix libs
parent
e51f0cae
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
105 additions
and
14 deletions
+105
-14
pom.xml
pom.xml
+13
-7
EurekaClientConfigBean.java
...ramework/cloud/netflix/eureka/EurekaClientConfigBean.java
+8
-0
EurekaServerConfigBean.java
...ramework/cloud/netflix/eureka/EurekaServerConfigBean.java
+19
-0
RibbonLoadBalancerClient.java
...mework/cloud/netflix/ribbon/RibbonLoadBalancerClient.java
+7
-7
RibbonLoadBalancerContext.java
...ework/cloud/netflix/ribbon/RibbonLoadBalancerContext.java
+45
-0
SpringAggregatorFactory.java
...mework/cloud/netflix/turbine/SpringAggregatorFactory.java
+13
-0
No files found.
pom.xml
View file @
dfaad78d
...
...
@@ -121,6 +121,12 @@
<groupId>
com.netflix.feign
</groupId>
<artifactId>
feign-ribbon
</artifactId>
<version>
${feign.version}
</version>
<exclusions>
<exclusion>
<groupId>
com.netflix.ribbon
</groupId>
<artifactId>
ribbon-loadbalancer
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--<dependency>
<groupId>com.netflix.feign</groupId>
...
...
@@ -249,14 +255,14 @@
</dependencyManagement>
<properties>
<archaius.version>
0.6.
0
</archaius.version>
<eureka.version>
1.1.1
3
5
</eureka.version>
<feign.version>
6.1.
2
</feign.version>
<archaius.version>
0.6.
3
</archaius.version>
<eureka.version>
1.1.1
4
5
</eureka.version>
<feign.version>
6.1.
3
</feign.version>
<hystrix.version>
1.4.0-RC5
</hystrix.version>
<ribbon.version>
2.0-RC
9
</ribbon.version>
<turbine.version>
0.4
</turbine.version>
<zuul.version>
1.0.2
4
</zuul.version>
<netflix.rxjava.version>
0.20.
6
</netflix.rxjava.version>
<ribbon.version>
2.0-RC
13
</ribbon.version>
<turbine.version>
1.0.0
</turbine.version>
<zuul.version>
1.0.2
8
</zuul.version>
<netflix.rxjava.version>
0.20.
7
</netflix.rxjava.version>
</properties>
</project>
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientConfigBean.java
View file @
dfaad78d
...
...
@@ -55,6 +55,10 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
private
String
proxyHost
;
private
String
proxyUserName
;
private
String
proxyPassword
;
private
int
eurekaServerReadTimeoutSeconds
=
8
;
private
int
eurekaServerConnectTimeoutSeconds
=
5
;
...
...
@@ -79,8 +83,12 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
private
int
heartbeatExecutorThreadPoolSize
=
2
;
private
int
heartbeatExecutorExponentialBackOffBound
=
10
;
private
int
cacheRefreshExecutorThreadPoolSize
=
2
;
private
int
cacheRefreshExecutorExponentialBackOffBound
=
10
;
private
Map
<
String
,
String
>
serviceUrl
=
new
HashMap
<
String
,
String
>();
{
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaServerConfigBean.java
View file @
dfaad78d
...
...
@@ -15,6 +15,7 @@
*/
package
org
.
springframework
.
cloud
.
netflix
.
eureka
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Set
;
...
...
@@ -181,4 +182,22 @@ public class EurekaServerConfigBean implements EurekaServerConfig {
return
batchReplication
;
}
private
boolean
logIdentityHeaders
=
true
;
@Override
public
boolean
shouldLogIdentityHeaders
()
{
return
logIdentityHeaders
;
}
private
boolean
rateLimiterEnabled
=
false
;
private
boolean
rateLimiterThrottleStandardClients
=
false
;
private
Set
<
String
>
rateLimiterPrivilegedClients
=
Collections
.
emptySet
();
private
int
rateLimiterBurstSize
=
10
;
private
int
rateLimiterRegistryFetchAverageRate
=
500
;
private
int
rateLimiterFullFetchAverageRate
=
100
;
}
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonLoadBalancerClient.java
View file @
dfaad78d
...
...
@@ -24,7 +24,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
private
SpringClientFactory
clientFactory
;
private
Map
<
String
,
ILoadBalancer
>
balancers
=
new
HashMap
<>();
private
Map
<
String
,
LoadBalancerContext
>
contexts
=
new
HashMap
<>();
private
Map
<
String
,
Ribbon
LoadBalancerContext
>
contexts
=
new
HashMap
<>();
public
RibbonLoadBalancerClient
(
RibbonClientPreprocessor
ribbonClientPreprocessor
,
SpringClientFactory
clientFactory
,
List
<
BaseLoadBalancer
>
balancers
)
{
this
.
ribbonClientPreprocessor
=
ribbonClientPreprocessor
;
...
...
@@ -37,7 +37,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
@Override
public
URI
reconstructURI
(
ServiceInstance
instance
,
URI
original
)
{
String
serviceId
=
instance
.
getServiceId
();
LoadBalancerContext
context
=
getOrCreateLoadBalancerContext
(
serviceId
,
getLoadBalancer
(
serviceId
));
Ribbon
LoadBalancerContext
context
=
getOrCreateLoadBalancerContext
(
serviceId
,
getLoadBalancer
(
serviceId
));
Server
server
=
new
Server
(
instance
.
getHost
(),
instance
.
getPort
());
return
context
.
reconstructURIWithServer
(
server
,
original
);
}
...
...
@@ -50,7 +50,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
@Override
public
<
T
>
T
execute
(
String
serviceId
,
LoadBalancerRequest
<
T
>
request
)
{
ILoadBalancer
loadBalancer
=
getLoadBalancer
(
serviceId
);
LoadBalancerContext
context
=
getOrCreateLoadBalancerContext
(
serviceId
,
loadBalancer
);
Ribbon
LoadBalancerContext
context
=
getOrCreateLoadBalancerContext
(
serviceId
,
loadBalancer
);
Server
server
=
getServer
(
serviceId
,
loadBalancer
);
RibbonServer
ribbonServer
=
new
RibbonServer
(
serviceId
,
server
);
...
...
@@ -70,16 +70,16 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
return
null
;
}
private
void
recordStats
(
LoadBalancerContext
context
,
Stopwatch
tracer
,
ServerStats
serverStats
,
Object
entity
,
Throwable
exception
)
{
private
void
recordStats
(
Ribbon
LoadBalancerContext
context
,
Stopwatch
tracer
,
ServerStats
serverStats
,
Object
entity
,
Throwable
exception
)
{
tracer
.
stop
();
long
duration
=
tracer
.
getDuration
(
TimeUnit
.
MILLISECONDS
);
context
.
noteRequestCompletion
(
serverStats
,
entity
,
exception
,
duration
,
null
/*errorHandler*/
);
}
protected
LoadBalancerContext
getOrCreateLoadBalancerContext
(
String
serviceId
,
ILoadBalancer
loadBalancer
)
{
LoadBalancerContext
context
=
contexts
.
get
(
serviceId
);
protected
Ribbon
LoadBalancerContext
getOrCreateLoadBalancerContext
(
String
serviceId
,
ILoadBalancer
loadBalancer
)
{
Ribbon
LoadBalancerContext
context
=
contexts
.
get
(
serviceId
);
if
(
context
==
null
)
{
context
=
new
LoadBalancerContext
(
loadBalancer
);
context
=
new
Ribbon
LoadBalancerContext
(
loadBalancer
);
contexts
.
put
(
serviceId
,
context
);
}
return
context
;
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonLoadBalancerContext.java
0 → 100644
View file @
dfaad78d
package
org
.
springframework
.
cloud
.
netflix
.
ribbon
;
import
com.netflix.client.RetryHandler
;
import
com.netflix.client.config.IClientConfig
;
import
com.netflix.loadbalancer.ILoadBalancer
;
import
com.netflix.loadbalancer.LoadBalancerContext
;
import
com.netflix.loadbalancer.ServerStats
;
import
com.netflix.servo.monitor.Timer
;
/**
* @author Spencer Gibb
*/
public
class
RibbonLoadBalancerContext
extends
LoadBalancerContext
{
public
RibbonLoadBalancerContext
(
ILoadBalancer
lb
)
{
super
(
lb
);
}
public
RibbonLoadBalancerContext
(
ILoadBalancer
lb
,
IClientConfig
clientConfig
)
{
super
(
lb
,
clientConfig
);
}
public
RibbonLoadBalancerContext
(
ILoadBalancer
lb
,
IClientConfig
clientConfig
,
RetryHandler
handler
)
{
super
(
lb
,
clientConfig
,
handler
);
}
@Override
public
void
noteOpenConnection
(
ServerStats
serverStats
)
{
super
.
noteOpenConnection
(
serverStats
);
}
@Override
public
Timer
getExecuteTracer
()
{
return
super
.
getExecuteTracer
();
}
@Override
public
void
noteRequestCompletion
(
ServerStats
stats
,
Object
response
,
Throwable
e
,
long
responseTime
)
{
super
.
noteRequestCompletion
(
stats
,
response
,
e
,
responseTime
);
}
@Override
public
void
noteRequestCompletion
(
ServerStats
stats
,
Object
response
,
Throwable
e
,
long
responseTime
,
RetryHandler
errorHandler
)
{
super
.
noteRequestCompletion
(
stats
,
response
,
e
,
responseTime
,
errorHandler
);
}
}
spring-cloud-netflix-turbine/src/main/java/org/springframework/cloud/netflix/turbine/SpringAggregatorFactory.java
View file @
dfaad78d
...
...
@@ -79,6 +79,19 @@ public class SpringAggregatorFactory implements ClusterMonitorFactory<AggDataFro
return
clusters
;
}
/**
* shutdown all configured cluster monitors
*/
@Override
public
void
shutdownClusterMonitors
()
{
for
(
String
clusterName
:
getClusterNames
())
{
ClusterMonitor
<
AggDataFromCluster
>
clusterMonitor
=
(
ClusterMonitor
<
AggDataFromCluster
>)
AggregateClusterMonitor
.
findOrRegisterAggregateMonitor
(
clusterName
);
clusterMonitor
.
stopMonitor
();
clusterMonitor
.
getDispatcher
().
stopDispatcher
();
}
}
private
TurbineDataHandler
<
AggDataFromCluster
>
StaticListener
=
new
TurbineDataHandler
<
AggDataFromCluster
>()
{
@Override
...
...
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