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
c3f08bb0
Commit
c3f08bb0
authored
Jul 14, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级到F版
parent
bf2a0670
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
41 additions
and
108 deletions
+41
-108
discovery-console/pom.xml
+1
-1
discovery-console/src/main/java/com/nepxion/discovery/console/configuration/ConsoleAutoConfiguration.java
+1
-1
discovery-console/src/main/java/com/nepxion/discovery/console/configuration/SwaggerConfiguration.java
+2
-2
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/configuration/AdminAutoConfiguration.java
+1
-1
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/configuration/SwaggerConfiguration.java
+2
-2
discovery-plugin-framework-eureka/pom.xml
+2
-7
discovery-plugin-framework-eureka/src/main/java/com/nepxion/discovery/plugin/framework/configuration/EurekaLoadBalanceConfiguration.java
+2
-1
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/configuration/ZookeeperLoadBalanceConfiguration.java
+20
-7
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/decorator/ZookeeperServiceRegistryDecorator.java
+0
-15
discovery-plugin-framework/pom.xml
+1
-1
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/configuration/PluginAutoConfiguration.java
+0
-6
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/context/PluginContainerInitializedHandler.java
+0
-27
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/DiscoveryClientDecorator.java
+0
-6
discovery-springcloud-example-console/pom.xml
+2
-3
discovery-springcloud-example-eureka/pom.xml
+3
-4
discovery-springcloud-example/pom.xml
+2
-3
pom.xml
+2
-21
No files found.
discovery-console/pom.xml
View file @
c3f08bb0
...
...
@@ -37,7 +37,7 @@
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-ribbon
</artifactId>
<artifactId>
spring-cloud-starter-
netflix-
ribbon
</artifactId>
</dependency>
<dependency>
...
...
discovery-console/src/main/java/com/nepxion/discovery/console/configuration/ConsoleAutoConfiguration.java
View file @
c3f08bb0
...
...
@@ -9,7 +9,7 @@ package com.nepxion.discovery.console.configuration;
* @version 1.0
*/
import
org.springframework.boot.actuate.endpoint.Endpoint
;
import
org.springframework.boot.actuate.endpoint.
annotation.
Endpoint
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
discovery-console/src/main/java/com/nepxion/discovery/console/configuration/SwaggerConfiguration.java
View file @
c3f08bb0
...
...
@@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Adapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
...
...
@@ -26,7 +26,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public
class
SwaggerConfiguration
extends
WebMvcConfigurerAdapt
er
{
public
class
SwaggerConfiguration
implements
WebMvcConfigur
er
{
@Value
(
"${spring.application.name}"
)
private
String
serviceName
;
...
...
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/configuration/AdminAutoConfiguration.java
View file @
c3f08bb0
...
...
@@ -9,7 +9,7 @@ package com.nepxion.discovery.plugin.admincenter.configuration;
* @version 1.0
*/
import
org.springframework.boot.actuate.endpoint.Endpoint
;
import
org.springframework.boot.actuate.endpoint.
annotation.
Endpoint
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/configuration/SwaggerConfiguration.java
View file @
c3f08bb0
...
...
@@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Adapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
...
...
@@ -26,7 +26,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public
class
SwaggerConfiguration
extends
WebMvcConfigurerAdapt
er
{
public
class
SwaggerConfiguration
implements
WebMvcConfigur
er
{
@Value
(
"${spring.application.name}"
)
private
String
serviceName
;
...
...
discovery-plugin-framework-eureka/pom.xml
View file @
c3f08bb0
...
...
@@ -22,13 +22,7 @@
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
<dependency>
<groupId>
javax.inject
</groupId>
<artifactId>
javax.inject
</artifactId>
<scope>
provided
</scope>
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
discovery-plugin-framework-eureka/src/main/java/com/nepxion/discovery/plugin/framework/configuration/EurekaLoadBalanceConfiguration.java
View file @
c3f08bb0
...
...
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.cloud.netflix.ribbon.PropertiesFactory
;
import
org.springframework.cloud.netflix.ribbon.RibbonClientName
;
import
org.springframework.cloud.netflix.ribbon.eureka.EurekaRibbonClientConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -33,7 +34,7 @@ public class EurekaLoadBalanceConfiguration {
@Value
(
"${ribbon.eureka.approximateZoneFromHostname:false}"
)
private
boolean
approximateZoneFromHostname
=
false
;
@
Value
(
"${ribbon.client.name}"
)
@
RibbonClientName
private
String
serviceId
=
"client"
;
@Autowired
...
...
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/configuration/ZookeeperLoadBalanceConfiguration.java
View file @
c3f08bb0
...
...
@@ -9,10 +9,14 @@ package com.nepxion.discovery.plugin.framework.configuration;
* @version 1.0
*/
import
org.apache.curator.x.discovery.ServiceDiscovery
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.cloud.zookeeper.discovery.ZookeeperInstance
;
import
org.springframework.cloud.zookeeper.discovery.ZookeeperRibbonClientConfiguration
;
import
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistry
;
import
org.springframework.cloud.zookeeper.discovery.dependency.ConditionalOnDependenciesNotPassed
;
import
org.springframework.cloud.zookeeper.discovery.dependency.ConditionalOnDependenciesPassed
;
import
org.springframework.cloud.zookeeper.discovery.dependency.ZookeeperDependencies
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.env.ConfigurableEnvironment
;
...
...
@@ -26,18 +30,27 @@ import com.netflix.loadbalancer.ServerList;
@AutoConfigureAfter
(
ZookeeperRibbonClientConfiguration
.
class
)
public
class
ZookeeperLoadBalanceConfiguration
{
@Autowired
private
ZookeeperServiceRegistry
registry
;
@Autowired
private
ConfigurableEnvironment
environment
;
@Autowired
private
LoadBalanceListenerExecutor
loadBalanceListenerExecutor
;
@Bean
public
ServerList
<?>
ribbonServerList
(
IClientConfig
config
)
{
@SuppressWarnings
(
"deprecation"
)
ZookeeperServerListDecorator
serverList
=
new
ZookeeperServerListDecorator
(
this
.
registry
.
getServiceDiscoveryRef
().
get
());
@ConditionalOnDependenciesPassed
public
ServerList
<?>
ribbonServerListFromDependencies
(
IClientConfig
config
,
ZookeeperDependencies
zookeeperDependencies
,
ServiceDiscovery
<
ZookeeperInstance
>
serviceDiscovery
)
{
ZookeeperServerListDecorator
serverList
=
new
ZookeeperServerListDecorator
(
serviceDiscovery
);
serverList
.
initFromDependencies
(
config
,
zookeeperDependencies
);
serverList
.
setEnvironment
(
environment
);
serverList
.
setLoadBalanceListenerExecutor
(
loadBalanceListenerExecutor
);
serverList
.
setServiceId
(
config
.
getClientName
());
return
serverList
;
}
@Bean
@ConditionalOnDependenciesNotPassed
public
ServerList
<?>
ribbonServerList
(
IClientConfig
config
,
ServiceDiscovery
<
ZookeeperInstance
>
serviceDiscovery
)
{
ZookeeperServerListDecorator
serverList
=
new
ZookeeperServerListDecorator
(
serviceDiscovery
);
serverList
.
initWithNiwsConfig
(
config
);
serverList
.
setEnvironment
(
environment
);
serverList
.
setLoadBalanceListenerExecutor
(
loadBalanceListenerExecutor
);
...
...
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/decorator/ZookeeperServiceRegistryDecorator.java
View file @
c3f08bb0
...
...
@@ -9,11 +9,6 @@ package com.nepxion.discovery.plugin.framework.decorator;
* @version 1.0
*/
import
java.util.concurrent.atomic.AtomicReference
;
import
org.apache.curator.framework.CuratorFramework
;
import
org.apache.curator.x.discovery.ServiceDiscovery
;
import
org.springframework.cloud.zookeeper.discovery.ZookeeperInstance
;
import
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperRegistration
;
import
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistry
;
import
org.springframework.context.ConfigurableApplicationContext
;
...
...
@@ -89,16 +84,6 @@ public class ZookeeperServiceRegistryDecorator extends ZookeeperServiceRegistry
serviceRegistry
.
afterSingletonsInstantiated
();
}
@Deprecated
public
CuratorFramework
getCurator
()
{
return
serviceRegistry
.
getCurator
();
}
@Deprecated
public
AtomicReference
<
ServiceDiscovery
<
ZookeeperInstance
>>
getServiceDiscoveryRef
()
{
return
serviceRegistry
.
getServiceDiscoveryRef
();
}
public
ConfigurableEnvironment
getEnvironment
()
{
return
environment
;
}
...
...
discovery-plugin-framework/pom.xml
View file @
c3f08bb0
...
...
@@ -42,7 +42,7 @@
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-ribbon
</artifactId>
<artifactId>
spring-cloud-starter-
netflix-
ribbon
</artifactId>
</dependency>
<dependency>
...
...
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/configuration/PluginAutoConfiguration.java
View file @
c3f08bb0
...
...
@@ -14,7 +14,6 @@ import org.springframework.context.annotation.Configuration;
import
com.nepxion.discovery.plugin.framework.cache.PluginCache
;
import
com.nepxion.discovery.plugin.framework.cache.RuleCache
;
import
com.nepxion.discovery.plugin.framework.context.PluginContainerInitializedHandler
;
import
com.nepxion.discovery.plugin.framework.context.PluginContextAware
;
import
com.nepxion.discovery.plugin.framework.event.PluginEventWapper
;
import
com.nepxion.discovery.plugin.framework.event.PluginPublisher
;
...
...
@@ -32,11 +31,6 @@ import com.nepxion.discovery.plugin.framework.listener.register.RegisterListener
@Configuration
public
class
PluginAutoConfiguration
{
@Bean
public
PluginContainerInitializedHandler
pluginContainerInitializedHandler
()
{
return
new
PluginContainerInitializedHandler
();
}
@Bean
public
PluginContextAware
pluginContextAware
()
{
return
new
PluginContextAware
();
}
...
...
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/context/PluginContainerInitializedHandler.java
deleted
100644 → 0
View file @
bf2a0670
package
com
.
nepxion
.
discovery
.
plugin
.
framework
.
context
;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
import
org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent
;
import
org.springframework.context.ApplicationListener
;
public
class
PluginContainerInitializedHandler
implements
ApplicationListener
<
EmbeddedServletContainerInitializedEvent
>
{
private
int
serverPort
;
@Override
public
void
onApplicationEvent
(
EmbeddedServletContainerInitializedEvent
event
)
{
serverPort
=
event
.
getEmbeddedServletContainer
().
getPort
();
}
public
int
getPort
()
{
return
serverPort
;
}
}
\ No newline at end of file
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/DiscoveryClientDecorator.java
View file @
c3f08bb0
...
...
@@ -64,12 +64,6 @@ public class DiscoveryClientDecorator implements DiscoveryClient {
return
discoveryClient
.
getServices
();
}
@Deprecated
@Override
public
ServiceInstance
getLocalServiceInstance
()
{
return
discoveryClient
.
getLocalServiceInstance
();
}
@Override
public
String
description
()
{
return
discoveryClient
.
description
();
...
...
discovery-springcloud-example-console/pom.xml
View file @
c3f08bb0
...
...
@@ -13,13 +13,12 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.14
.RELEASE
</version>
<version>
2.0.3
.RELEASE
</version>
</parent>
<properties>
<discovery.plugin.version>
3.3.20
</discovery.plugin.version>
<spring.cloud.version>
Edgware.SR4
</spring.cloud.version>
<!-- <spring.cloud.version>Dalston.SR5</spring.cloud.version> -->
<spring.cloud.version>
Finchley.RELEASE
</spring.cloud.version>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
...
...
discovery-springcloud-example-eureka/pom.xml
View file @
c3f08bb0
...
...
@@ -13,12 +13,11 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.14
.RELEASE
</version>
<version>
2.0.3
.RELEASE
</version>
</parent>
<properties>
<spring.cloud.version>
Edgware.SR4
</spring.cloud.version>
<!-- <spring.cloud.version>Dalston.SR5</spring.cloud.version> -->
<spring.cloud.version>
Finchley.RELEASE
</spring.cloud.version>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
...
...
@@ -38,7 +37,7 @@
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka-server
</artifactId>
<artifactId>
spring-cloud-starter-
netflix-
eureka-server
</artifactId>
</dependency>
</dependencies>
...
...
discovery-springcloud-example/pom.xml
View file @
c3f08bb0
...
...
@@ -13,13 +13,12 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.14
.RELEASE
</version>
<version>
2.0.3
.RELEASE
</version>
</parent>
<properties>
<discovery.plugin.version>
3.3.20
</discovery.plugin.version>
<spring.cloud.version>
Edgware.SR4
</spring.cloud.version>
<!-- <spring.cloud.version>Dalston.SR5</spring.cloud.version> -->
<spring.cloud.version>
Finchley.RELEASE
</spring.cloud.version>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
...
...
pom.xml
View file @
c3f08bb0
...
...
@@ -35,11 +35,8 @@
<dom4j.version>
1.6.1
</dom4j.version>
<caffeine.version>
2.6.2
</caffeine.version>
<swagger.version>
2.7.0
</swagger.version>
<spring.cloud.version>
Edgware.SR4
</spring.cloud.version>
<!-- <spring.cloud.version>Dalston.SR5</spring.cloud.version> -->
<spring.cloud.consul.version>
2.0.0.RELEASE
</spring.cloud.consul.version>
<spring.cloud.zookeeper.version>
2.0.0.RELEASE
</spring.cloud.zookeeper.version>
<spring.boot.version>
1.5.14.RELEASE
</spring.boot.version>
<spring.cloud.version>
Finchley.RELEASE
</spring.cloud.version>
<spring.boot.version>
2.0.3.RELEASE
</spring.boot.version>
<disruptor.version>
3.3.7
</disruptor.version>
<log4j.version>
2.9.1
</log4j.version>
<java.version>
1.8
</java.version>
...
...
@@ -171,22 +168,6 @@
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-consul-dependencies
</artifactId>
<version>
${spring.cloud.consul.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-zookeeper-dependencies
</artifactId>
<version>
${spring.cloud.zookeeper.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring.boot.version}
</version>
...
...
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