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
fcb3daf9
Commit
fcb3daf9
authored
Jun 29, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加对Zookeeper服务注册发现的支持
parent
b608dda5
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
374 additions
and
15 deletions
+374
-15
discovery-plugin-framework-eureka/pom.xml
+1
-1
discovery-plugin-framework-eureka/src/main/java/com/nepxion/discovery/plugin/framework/decorator/EurekaServiceRegistryDecorator.java
+2
-3
discovery-plugin-framework-zookeeper/pom.xml
+29
-0
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/adapter/ZookeeperAdapter.java
+40
-0
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/configuration/ZookeeperAutoConfiguration.java
+25
-0
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/constant/ZookeeperConstant.java
+15
-0
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/context/ZookeeperApplicationContextInitializer.java
+36
-0
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/decorator/ZookeeperServiceRegistryDecorator.java
+91
-0
discovery-plugin-starter-zookeeper/pom.xml
+39
-0
discovery-plugin-starter-zookeeper/src/main/resources/META-INF/spring.factories
+10
-0
discovery-springcloud-example-a/pom.xml
+2
-1
discovery-springcloud-example-a/src/main/resources/application.properties
+5
-0
discovery-springcloud-example-b/pom.xml
+2
-1
discovery-springcloud-example-b/src/main/resources/application-1.properties
+7
-0
discovery-springcloud-example-b/src/main/resources/application-2.properties
+7
-0
discovery-springcloud-example-b/src/main/resources/bootstrap.properties
+5
-0
discovery-springcloud-example-c/pom.xml
+8
-1
discovery-springcloud-example-c/src/main/resources/application-1.properties
+7
-2
discovery-springcloud-example-c/src/main/resources/application-2.properties
+7
-2
discovery-springcloud-example-c/src/main/resources/application-3.properties
+7
-2
discovery-springcloud-example-c/src/main/resources/bootstrap.properties
+6
-2
pom.xml
+23
-0
No files found.
discovery-plugin-framework-eureka/pom.xml
View file @
fcb3daf9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<artifactId>
discovery-plugin-framework-eureka
</artifactId>
<artifactId>
discovery-plugin-framework-eureka
</artifactId>
<name>
Nepxion Discovery Plugin Framework
</name>
<name>
Nepxion Discovery Plugin Framework
Eureka
</name>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<description>
Nepxion Discovery is an enhancement for Spring Cloud Discovery
</description>
<description>
Nepxion Discovery is an enhancement for Spring Cloud Discovery
</description>
...
...
discovery-plugin-framework-eureka/src/main/java/com/nepxion/discovery/plugin/framework/decorator/EurekaServiceRegistryDecorator.java
View file @
fcb3daf9
...
@@ -9,7 +9,6 @@ package com.nepxion.discovery.plugin.framework.decorator;
...
@@ -9,7 +9,6 @@ package com.nepxion.discovery.plugin.framework.decorator;
* @version 1.0
* @version 1.0
*/
*/
import
org.springframework.cloud.client.serviceregistry.ServiceRegistry
;
import
org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration
;
import
org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration
;
import
org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry
;
import
org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.ConfigurableApplicationContext
;
...
@@ -19,11 +18,11 @@ import com.nepxion.discovery.plugin.framework.context.PluginContextAware;
...
@@ -19,11 +18,11 @@ import com.nepxion.discovery.plugin.framework.context.PluginContextAware;
import
com.nepxion.discovery.plugin.framework.listener.RegisterListenerExecutor
;
import
com.nepxion.discovery.plugin.framework.listener.RegisterListenerExecutor
;
public
class
EurekaServiceRegistryDecorator
extends
EurekaServiceRegistry
{
public
class
EurekaServiceRegistryDecorator
extends
EurekaServiceRegistry
{
private
ServiceRegistry
<
EurekaRegistration
>
serviceRegistry
;
private
EurekaServiceRegistry
serviceRegistry
;
private
ConfigurableApplicationContext
applicationContext
;
private
ConfigurableApplicationContext
applicationContext
;
private
ConfigurableEnvironment
environment
;
private
ConfigurableEnvironment
environment
;
public
EurekaServiceRegistryDecorator
(
ServiceRegistry
<
EurekaRegistration
>
serviceRegistry
,
ConfigurableApplicationContext
applicationContext
)
{
public
EurekaServiceRegistryDecorator
(
EurekaServiceRegistry
serviceRegistry
,
ConfigurableApplicationContext
applicationContext
)
{
this
.
serviceRegistry
=
serviceRegistry
;
this
.
serviceRegistry
=
serviceRegistry
;
this
.
applicationContext
=
applicationContext
;
this
.
applicationContext
=
applicationContext
;
this
.
environment
=
applicationContext
.
getEnvironment
();
this
.
environment
=
applicationContext
.
getEnvironment
();
...
...
discovery-plugin-framework-zookeeper/pom.xml
0 → 100644
View file @
fcb3daf9
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<artifactId>
discovery-plugin-framework-zookeeper
</artifactId>
<name>
Nepxion Discovery Plugin Framework Zookeeper
</name>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<description>
Nepxion Discovery is an enhancement for Spring Cloud Discovery
</description>
<url>
http://www.nepxion.com
</url>
<parent>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery
</artifactId>
<version>
2.0.11
</version>
</parent>
<dependencies>
<dependency>
<groupId>
${project.groupId}
</groupId>
<artifactId>
discovery-plugin-framework
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-zookeeper-discovery
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/adapter/ZookeeperAdapter.java
0 → 100644
View file @
fcb3daf9
package
com
.
nepxion
.
discovery
.
plugin
.
framework
.
adapter
;
/**
* <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.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.client.serviceregistry.Registration
;
import
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperRegistration
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
com.nepxion.discovery.plugin.framework.constant.ZookeeperConstant
;
import
com.nepxion.discovery.plugin.framework.exception.PluginException
;
public
class
ZookeeperAdapter
implements
PluginAdapter
{
@Autowired
protected
ConfigurableEnvironment
environment
;
@Override
public
String
getIpAddress
(
Registration
registration
)
{
if
(
registration
instanceof
ZookeeperRegistration
)
{
ZookeeperRegistration
zookeeperRegistration
=
(
ZookeeperRegistration
)
registration
;
return
zookeeperRegistration
.
getServiceInstance
().
getAddress
();
}
throw
new
PluginException
(
"Registration instance isn't the type of Zookeeper"
);
}
@Override
public
String
getVersion
()
{
return
environment
.
getProperty
(
ZookeeperConstant
.
ZOOKEEPER_METADATA_VERSION
);
}
}
\ No newline at end of file
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/configuration/ZookeeperAutoConfiguration.java
0 → 100644
View file @
fcb3daf9
package
com
.
nepxion
.
discovery
.
plugin
.
framework
.
configuration
;
/**
* <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.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
com.nepxion.discovery.plugin.framework.adapter.ZookeeperAdapter
;
import
com.nepxion.discovery.plugin.framework.adapter.PluginAdapter
;
@Configuration
public
class
ZookeeperAutoConfiguration
{
@Bean
public
PluginAdapter
pluginAdapter
()
{
return
new
ZookeeperAdapter
();
}
}
\ No newline at end of file
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/constant/ZookeeperConstant.java
0 → 100644
View file @
fcb3daf9
package
com
.
nepxion
.
discovery
.
plugin
.
framework
.
constant
;
/**
* <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
*/
public
class
ZookeeperConstant
{
public
static
final
String
ZOOKEEPER_METADATA_VERSION
=
"spring.cloud.zookeeper.discovery.metadata.version"
;
}
\ No newline at end of file
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/context/ZookeeperApplicationContextInitializer.java
0 → 100644
View file @
fcb3daf9
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.beans.BeansException
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistry
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
com.nepxion.discovery.plugin.framework.decorator.DiscoveryClientDecorator
;
import
com.nepxion.discovery.plugin.framework.decorator.ZookeeperServiceRegistryDecorator
;
public
class
ZookeeperApplicationContextInitializer
extends
PluginApplicationContextInitializer
{
@Override
protected
Object
afterInitialization
(
ConfigurableApplicationContext
applicationContext
,
Object
bean
,
String
beanName
)
throws
BeansException
{
if
(
bean
instanceof
DiscoveryClient
)
{
DiscoveryClient
discoveryClient
=
(
DiscoveryClient
)
bean
;
return
new
DiscoveryClientDecorator
(
discoveryClient
,
applicationContext
);
}
else
if
(
bean
instanceof
ZookeeperServiceRegistry
)
{
ZookeeperServiceRegistry
zookeeperServiceRegistry
=
(
ZookeeperServiceRegistry
)
bean
;
return
new
ZookeeperServiceRegistryDecorator
(
zookeeperServiceRegistry
,
applicationContext
);
}
else
{
return
bean
;
}
}
}
\ No newline at end of file
discovery-plugin-framework-zookeeper/src/main/java/com/nepxion/discovery/plugin/framework/decorator/ZookeeperServiceRegistryDecorator.java
0 → 100644
View file @
fcb3daf9
package
com
.
nepxion
.
discovery
.
plugin
.
framework
.
decorator
;
/**
* <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.cloud.zookeeper.serviceregistry.ZookeeperRegistration
;
import
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistry
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
com.nepxion.discovery.plugin.framework.context.PluginContextAware
;
import
com.nepxion.discovery.plugin.framework.listener.RegisterListenerExecutor
;
public
class
ZookeeperServiceRegistryDecorator
extends
ZookeeperServiceRegistry
{
private
ZookeeperServiceRegistry
serviceRegistry
;
private
ConfigurableApplicationContext
applicationContext
;
private
ConfigurableEnvironment
environment
;
public
ZookeeperServiceRegistryDecorator
(
ZookeeperServiceRegistry
serviceRegistry
,
ConfigurableApplicationContext
applicationContext
)
{
super
(
null
);
this
.
serviceRegistry
=
serviceRegistry
;
this
.
applicationContext
=
applicationContext
;
this
.
environment
=
applicationContext
.
getEnvironment
();
}
@Override
public
void
register
(
ZookeeperRegistration
registration
)
{
Boolean
registerControlEnabled
=
PluginContextAware
.
isRegisterControlEnabled
(
environment
);
if
(
registerControlEnabled
)
{
RegisterListenerExecutor
registerListenerExecutor
=
applicationContext
.
getBean
(
RegisterListenerExecutor
.
class
);
registerListenerExecutor
.
onRegister
(
registration
);
}
serviceRegistry
.
register
(
registration
);
}
@Override
public
void
deregister
(
ZookeeperRegistration
registration
)
{
Boolean
registerControlEnabled
=
PluginContextAware
.
isRegisterControlEnabled
(
environment
);
if
(
registerControlEnabled
)
{
RegisterListenerExecutor
registerListenerExecutor
=
applicationContext
.
getBean
(
RegisterListenerExecutor
.
class
);
registerListenerExecutor
.
onDeregister
(
registration
);
}
serviceRegistry
.
deregister
(
registration
);
}
@Override
public
void
setStatus
(
ZookeeperRegistration
registration
,
String
status
)
{
Boolean
registerControlEnabled
=
PluginContextAware
.
isRegisterControlEnabled
(
environment
);
if
(
registerControlEnabled
)
{
RegisterListenerExecutor
registerListenerExecutor
=
applicationContext
.
getBean
(
RegisterListenerExecutor
.
class
);
registerListenerExecutor
.
onSetStatus
(
registration
,
status
);
}
serviceRegistry
.
setStatus
(
registration
,
status
);
}
@Override
public
Object
getStatus
(
ZookeeperRegistration
registration
)
{
return
serviceRegistry
.
getStatus
(
registration
);
}
@Override
public
void
close
()
{
Boolean
registerControlEnabled
=
PluginContextAware
.
isRegisterControlEnabled
(
environment
);
if
(
registerControlEnabled
)
{
RegisterListenerExecutor
registerListenerExecutor
=
applicationContext
.
getBean
(
RegisterListenerExecutor
.
class
);
registerListenerExecutor
.
onClose
();
}
serviceRegistry
.
close
();
}
@Override
public
void
afterSingletonsInstantiated
()
{
serviceRegistry
.
afterSingletonsInstantiated
();
}
public
ConfigurableEnvironment
getEnvironment
()
{
return
environment
;
}
}
\ No newline at end of file
discovery-plugin-starter-zookeeper/pom.xml
0 → 100644
View file @
fcb3daf9
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<artifactId>
discovery-plugin-starter-zookeeper
</artifactId>
<name>
Nepxion Discovery Plugin Starter Zookeeper
</name>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<description>
Nepxion Discovery is an enhancement for Spring Cloud Discovery
</description>
<url>
http://www.nepxion.com
</url>
<parent>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery
</artifactId>
<version>
2.0.11
</version>
</parent>
<dependencies>
<dependency>
<groupId>
${project.groupId}
</groupId>
<artifactId>
discovery-plugin-config-center
</artifactId>
</dependency>
<dependency>
<groupId>
${project.groupId}
</groupId>
<artifactId>
discovery-plugin-admin-center
</artifactId>
</dependency>
<dependency>
<groupId>
${project.groupId}
</groupId>
<artifactId>
discovery-plugin-router-center
</artifactId>
</dependency>
<dependency>
<groupId>
${project.groupId}
</groupId>
<artifactId>
discovery-plugin-framework-zookeeper
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
discovery-plugin-starter-zookeeper/src/main/resources/META-INF/spring.factories
0 → 100644
View file @
fcb3daf9
org.springframework.context.ApplicationContextInitializer=\
com.nepxion.discovery.plugin.framework.context.ZookeeperApplicationContextInitializer
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.nepxion.discovery.plugin.framework.configuration.PluginAutoConfiguration,\
com.nepxion.discovery.plugin.framework.configuration.ZookeeperAutoConfiguration,\
com.nepxion.discovery.plugin.configcenter.configuration.ConfigAutoConfiguration,\
com.nepxion.discovery.plugin.admincenter.configuration.AdminAutoConfiguration,\
com.nepxion.discovery.plugin.routercenter.configuration.RouterAutoConfiguration
\ No newline at end of file
discovery-springcloud-example-a/pom.xml
View file @
fcb3daf9
...
@@ -39,7 +39,8 @@
...
@@ -39,7 +39,8 @@
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.nepxion
</groupId>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery-plugin-starter-eureka
</artifactId>
<!-- <artifactId>discovery-plugin-starter-eureka</artifactId> -->
<artifactId>
discovery-plugin-starter-zookeeper
</artifactId>
<version>
${discovery.plugin.version}
</version>
<version>
${discovery.plugin.version}
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
discovery-springcloud-example-a/src/main/resources/application.properties
View file @
fcb3daf9
...
@@ -7,6 +7,11 @@ eureka.client.serviceUrl.defaultZone=http://localhost:9528/eureka/
...
@@ -7,6 +7,11 @@ eureka.client.serviceUrl.defaultZone=http://localhost:9528/eureka/
eureka.instance.preferIpAddress
=
true
eureka.instance.preferIpAddress
=
true
eureka.instance.metadataMap.version
=
1.0
eureka.instance.metadataMap.version
=
1.0
# Zookeeper config
spring.cloud.zookeeper.connectString
=
localhost:2181
spring.cloud.zookeeper.discovery.root
=
/spring-cloud-service
spring.cloud.zookeeper.discovery.metadata.version
=
1.0
# Plugin config
# Plugin config
# 开启和关闭服务注册层面的控制。一旦关闭,服务注册的黑/白名单过滤功能将失效。缺失则默认为true
# 开启和关闭服务注册层面的控制。一旦关闭,服务注册的黑/白名单过滤功能将失效。缺失则默认为true
spring.application.register.control.enabled
=
true
spring.application.register.control.enabled
=
true
...
...
discovery-springcloud-example-b/pom.xml
View file @
fcb3daf9
...
@@ -39,7 +39,8 @@
...
@@ -39,7 +39,8 @@
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.nepxion
</groupId>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery-plugin-starter-eureka
</artifactId>
<!-- <artifactId>discovery-plugin-starter-eureka</artifactId> -->
<artifactId>
discovery-plugin-starter-zookeeper
</artifactId>
<version>
${discovery.plugin.version}
</version>
<version>
${discovery.plugin.version}
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
discovery-springcloud-example-b/src/main/resources/application-1.properties
View file @
fcb3daf9
# Spring cloud config
# Spring cloud config
server.port
=
1200
server.port
=
1200
# Eureka config
eureka.instance.metadataMap.version
=
1.0
eureka.instance.metadataMap.version
=
1.0
# Zookeeper config
spring.cloud.zookeeper.discovery.metadata.version
=
1.0
# Admin config
management.port
=
8200
management.port
=
8200
\ No newline at end of file
discovery-springcloud-example-b/src/main/resources/application-2.properties
View file @
fcb3daf9
# Spring cloud config
# Spring cloud config
server.port
=
1201
server.port
=
1201
# Eureka config
eureka.instance.metadataMap.version
=
1.1
eureka.instance.metadataMap.version
=
1.1
# Zookeeper config
spring.cloud.zookeeper.discovery.metadata.version
=
1.1
# Admin config
management.port
=
8201
management.port
=
8201
\ No newline at end of file
discovery-springcloud-example-b/src/main/resources/bootstrap.properties
View file @
fcb3daf9
...
@@ -5,4 +5,8 @@ spring.application.name=discovery-springcloud-example-b
...
@@ -5,4 +5,8 @@ spring.application.name=discovery-springcloud-example-b
eureka.client.serviceUrl.defaultZone
=
http://localhost:9528/eureka/
eureka.client.serviceUrl.defaultZone
=
http://localhost:9528/eureka/
eureka.instance.preferIpAddress
=
true
eureka.instance.preferIpAddress
=
true
# Zookeeper config
spring.cloud.zookeeper.connectString
=
localhost:2181
spring.cloud.zookeeper.discovery.root
=
/spring-cloud-service
management.security.enabled
=
false
management.security.enabled
=
false
\ No newline at end of file
discovery-springcloud-example-c/pom.xml
View file @
fcb3daf9
...
@@ -36,9 +36,16 @@
...
@@ -36,9 +36,16 @@
</dependencyManagement>
</dependencyManagement>
<dependencies>
<dependencies>
<!-- Zookeeper discovery needs spring-boot-starter-web -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
<!-- <artifactId>spring-cloud-starter-eureka</artifactId> -->
<artifactId>
spring-cloud-starter-zookeeper-discovery
</artifactId>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
discovery-springcloud-example-c/src/main/resources/application-1.properties
View file @
fcb3daf9
# Spring cloud config
# Spring cloud config
server.port
=
1300
server.port
=
1300
eureka.instance.metadataMap.version
=
1.0
\ No newline at end of file
# Eureka config
eureka.instance.metadataMap.version
=
1.0
# Zookeeper config
spring.cloud.zookeeper.discovery.metadata.version
=
1.0
\ No newline at end of file
discovery-springcloud-example-c/src/main/resources/application-2.properties
View file @
fcb3daf9
# Spring cloud config
# Spring cloud config
server.port
=
1301
server.port
=
1301
eureka.instance.metadataMap.version
=
1.1
\ No newline at end of file
# Eureka config
eureka.instance.metadataMap.version
=
1.1
# Zookeeper config
spring.cloud.zookeeper.discovery.metadata.version
=
1.1
\ No newline at end of file
discovery-springcloud-example-c/src/main/resources/application-3.properties
View file @
fcb3daf9
# Spring cloud config
# Spring cloud config
server.port
=
1302
server.port
=
1302
eureka.instance.metadataMap.version
=
1.2
\ No newline at end of file
# Eureka config
eureka.instance.metadataMap.version
=
1.2
# Zookeeper config
spring.cloud.zookeeper.discovery.metadata.version
=
1.2
\ No newline at end of file
discovery-springcloud-example-c/src/main/resources/bootstrap.properties
View file @
fcb3daf9
...
@@ -3,4 +3,8 @@ spring.application.name=discovery-springcloud-example-c
...
@@ -3,4 +3,8 @@ spring.application.name=discovery-springcloud-example-c
# Eureka config
# Eureka config
eureka.client.serviceUrl.defaultZone
=
http://localhost:9528/eureka/
eureka.client.serviceUrl.defaultZone
=
http://localhost:9528/eureka/
eureka.instance.preferIpAddress
=
true
eureka.instance.preferIpAddress
=
true
\ No newline at end of file
# Zookeeper config
spring.cloud.zookeeper.connectString
=
localhost:2181
spring.cloud.zookeeper.discovery.root
=
/spring-cloud-service
\ No newline at end of file
pom.xml
View file @
fcb3daf9
...
@@ -13,10 +13,12 @@
...
@@ -13,10 +13,12 @@
<modules>
<modules>
<module>
discovery-plugin-framework
</module>
<module>
discovery-plugin-framework
</module>
<module>
discovery-plugin-framework-eureka
</module>
<module>
discovery-plugin-framework-eureka
</module>
<module>
discovery-plugin-framework-zookeeper
</module>
<module>
discovery-plugin-config-center
</module>
<module>
discovery-plugin-config-center
</module>
<module>
discovery-plugin-admin-center
</module>
<module>
discovery-plugin-admin-center
</module>
<module>
discovery-plugin-router-center
</module>
<module>
discovery-plugin-router-center
</module>
<module>
discovery-plugin-starter-eureka
</module>
<module>
discovery-plugin-starter-eureka
</module>
<module>
discovery-plugin-starter-zookeeper
</module>
<module>
discovery-springcloud-example-eureka
</module>
<module>
discovery-springcloud-example-eureka
</module>
<module>
discovery-springcloud-example-a
</module>
<module>
discovery-springcloud-example-a
</module>
<module>
discovery-springcloud-example-b
</module>
<module>
discovery-springcloud-example-b
</module>
...
@@ -30,6 +32,7 @@
...
@@ -30,6 +32,7 @@
<commons.io.version>
2.5
</commons.io.version>
<commons.io.version>
2.5
</commons.io.version>
<dom4j.version>
1.6.1
</dom4j.version>
<dom4j.version>
1.6.1
</dom4j.version>
<spring.cloud.version>
Dalston.SR5
</spring.cloud.version>
<spring.cloud.version>
Dalston.SR5
</spring.cloud.version>
<spring.cloud.zookeeper.version>
2.0.0.RELEASE
</spring.cloud.zookeeper.version>
<!-- <spring.cloud.version>Edgware.SR3</spring.cloud.version> -->
<!-- <spring.cloud.version>Edgware.SR3</spring.cloud.version> -->
<spring.boot.version>
1.5.8.RELEASE
</spring.boot.version>
<spring.boot.version>
1.5.8.RELEASE
</spring.boot.version>
<disruptor.version>
3.3.7
</disruptor.version>
<disruptor.version>
3.3.7
</disruptor.version>
...
@@ -54,6 +57,12 @@
...
@@ -54,6 +57,12 @@
<dependency>
<dependency>
<groupId>
${project.groupId}
</groupId>
<groupId>
${project.groupId}
</groupId>
<artifactId>
discovery-plugin-framework-zookeeper
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
${project.groupId}
</groupId>
<artifactId>
discovery-plugin-config-center
</artifactId>
<artifactId>
discovery-plugin-config-center
</artifactId>
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
...
@@ -78,6 +87,12 @@
...
@@ -78,6 +87,12 @@
<dependency>
<dependency>
<groupId>
${project.groupId}
</groupId>
<groupId>
${project.groupId}
</groupId>
<artifactId>
discovery-plugin-starter-zookeeper
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
${project.groupId}
</groupId>
<artifactId>
eventbus-aop-starter
</artifactId>
<artifactId>
eventbus-aop-starter
</artifactId>
<version>
${eventbus.version}
</version>
<version>
${eventbus.version}
</version>
</dependency>
</dependency>
...
@@ -115,6 +130,14 @@
...
@@ -115,6 +130,14 @@
</dependency>
</dependency>
<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>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring.boot.version}
</version>
<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