Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈文顺
discovery
Commits
88f43e99
Commit
88f43e99
authored
Jul 04, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加扩展性
parent
e45482d4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
discovery-plugin-framework-consul/src/main/java/com/nepxion/discovery/plugin/framework/configuration/ConsulLoadBalanceConfiguration.java
+2
-0
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/configuration/ZookeeperLoadBalanceConfiguration.java
+2
-0
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/listener/loadbalance/LoadBalanceListenerExecutor.java
+0
-4
No files found.
discovery-plugin-framework-consul/src/main/java/com/nepxion/discovery/plugin/framework/configuration/ConsulLoadBalanceConfiguration.java
View file @
88f43e99
...
@@ -11,6 +11,7 @@ package com.nepxion.discovery.plugin.framework.configuration;
...
@@ -11,6 +11,7 @@ package com.nepxion.discovery.plugin.framework.configuration;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.cloud.consul.discovery.ConsulDiscoveryProperties
;
import
org.springframework.cloud.consul.discovery.ConsulDiscoveryProperties
;
import
org.springframework.cloud.consul.discovery.ConsulRibbonClientConfiguration
;
import
org.springframework.cloud.consul.discovery.ConsulRibbonClientConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -36,6 +37,7 @@ public class ConsulLoadBalanceConfiguration {
...
@@ -36,6 +37,7 @@ public class ConsulLoadBalanceConfiguration {
private
ConsulClient
client
;
private
ConsulClient
client
;
@Bean
@Bean
@ConditionalOnMissingBean
public
ServerList
<?>
ribbonServerList
(
IClientConfig
config
,
ConsulDiscoveryProperties
properties
)
{
public
ServerList
<?>
ribbonServerList
(
IClientConfig
config
,
ConsulDiscoveryProperties
properties
)
{
ConsulServerListDecorator
serverList
=
new
ConsulServerListDecorator
(
client
,
properties
);
ConsulServerListDecorator
serverList
=
new
ConsulServerListDecorator
(
client
,
properties
);
serverList
.
initWithNiwsConfig
(
config
);
serverList
.
initWithNiwsConfig
(
config
);
...
...
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/configuration/ZookeeperLoadBalanceConfiguration.java
View file @
88f43e99
...
@@ -11,6 +11,7 @@ package com.nepxion.discovery.plugin.framework.configuration;
...
@@ -11,6 +11,7 @@ package com.nepxion.discovery.plugin.framework.configuration;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.cloud.zookeeper.discovery.ZookeeperRibbonClientConfiguration
;
import
org.springframework.cloud.zookeeper.discovery.ZookeeperRibbonClientConfiguration
;
import
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistry
;
import
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistry
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -35,6 +36,7 @@ public class ZookeeperLoadBalanceConfiguration {
...
@@ -35,6 +36,7 @@ public class ZookeeperLoadBalanceConfiguration {
private
ZookeeperServiceRegistry
registry
;
private
ZookeeperServiceRegistry
registry
;
@Bean
@Bean
@ConditionalOnMissingBean
public
ServerList
<?>
ribbonServerList
(
IClientConfig
config
)
{
public
ServerList
<?>
ribbonServerList
(
IClientConfig
config
)
{
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
ZookeeperServerListDecorator
serverList
=
new
ZookeeperServerListDecorator
(
this
.
registry
.
getServiceDiscoveryRef
().
get
());
ZookeeperServerListDecorator
serverList
=
new
ZookeeperServerListDecorator
(
this
.
registry
.
getServiceDiscoveryRef
().
get
());
...
...
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/listener/loadbalance/LoadBalanceListenerExecutor.java
View file @
88f43e99
...
@@ -14,7 +14,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
...
@@ -14,7 +14,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.nepxion.discovery.plugin.framework.listener.discovery.DiscoveryListener
;
import
com.netflix.loadbalancer.Server
;
import
com.netflix.loadbalancer.Server
;
// 因为内置监听触发的时候,需要优先过滤,所以顺序执行
// 因为内置监听触发的时候,需要优先过滤,所以顺序执行
...
@@ -26,9 +25,6 @@ public class LoadBalanceListenerExecutor {
...
@@ -26,9 +25,6 @@ public class LoadBalanceListenerExecutor {
private
VersionFilterLoadBalanceListener
versionFilterLoadBalanceListener
;
private
VersionFilterLoadBalanceListener
versionFilterLoadBalanceListener
;
@Autowired
@Autowired
private
List
<
DiscoveryListener
>
discoveryListenerList
;
@Autowired
private
ReentrantReadWriteLock
reentrantReadWriteLock
;
private
ReentrantReadWriteLock
reentrantReadWriteLock
;
public
void
onGetServers
(
String
serviceId
,
List
<?
extends
Server
>
servers
)
{
public
void
onGetServers
(
String
serviceId
,
List
<?
extends
Server
>
servers
)
{
...
...
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