Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
matrix
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mall
arch
matrix
Commits
5fd29cae
Commit
5fd29cae
authored
May 24, 2021
by
房斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
底层支持nacos,其他不支持打印日志
parent
7d00ea38
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
144 additions
and
113 deletions
+144
-113
pom.xml
common-core/pom.xml
+1
-1
pom.xml
common-util/pom.xml
+1
-1
pom.xml
config-starter/pom.xml
+1
-1
pom.xml
logger-starter/pom.xml
+1
-1
pom.xml
matrix-bigdata/matrix-bigdata-hbase-starter/pom.xml
+1
-1
pom.xml
matrix-bigdata/matrix-bigdata-spark-starter/pom.xml
+1
-1
pom.xml
matrix-bigdata/pom.xml
+1
-1
pom.xml
matrix-bus/matrix-bus-canal-starter/pom.xml
+1
-1
pom.xml
matrix-bus/pom.xml
+1
-1
pom.xml
matrix-client/matrix-client-openfeign-starter/pom.xml
+1
-1
pom.xml
matrix-client/pom.xml
+1
-1
pom.xml
matrix-datahelper/matrix-datahelper-redis-core/pom.xml
+1
-1
pom.xml
matrix-datahelper/matrix-datahelper-redis-starter/pom.xml
+1
-1
pom.xml
matrix-datahelper/pom.xml
+2
-2
pom.xml
matrix-datasource/matrix-datasource-core/pom.xml
+1
-1
pom.xml
matrix-datasource/matrix-datasource-druid/pom.xml
+1
-1
pom.xml
matrix-datasource/pom.xml
+2
-2
pom.xml
matrix-gracefulshutdown/pom.xml
+17
-17
MatrixGracefulShutDownAutoConfiguration.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/gracefulshutdown/autoconfigure/MatrixGracefulShutDownAutoConfiguration.java
+4
-4
DubboCustomerShutDownHook.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/gracefulshutdown/component/hook/DubboCustomerShutDownHook.java
+32
-14
RegistryServerSync.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/gracefulshutdown/monitor/dubbo/service/RegistryServerSync.java
+21
-8
pom.xml
matrix-job/matrix-job-core/pom.xml
+1
-1
pom.xml
matrix-job/matrix-job-xxl-core/pom.xml
+1
-1
pom.xml
matrix-job/matrix-job-xxl-starter/pom.xml
+1
-1
pom.xml
matrix-job/pom.xml
+3
-3
pom.xml
matrix-mq/matrix-mq-rocketmq-client/pom.xml
+1
-1
pom.xml
matrix-mq/matrix-mq-rocketmq-core/pom.xml
+1
-1
pom.xml
matrix-mq/matrix-mq-rocketmq-starter/pom.xml
+1
-1
pom.xml
matrix-mq/pom.xml
+2
-2
pom.xml
matrix-mybatis/matrix-mybatis-core/pom.xml
+1
-1
pom.xml
matrix-mybatis/matrix-mybatis-starter/pom.xml
+1
-1
pom.xml
matrix-mybatis/pom.xml
+4
-4
pom.xml
matrix-protocol/matrix-protocol-core/pom.xml
+1
-1
pom.xml
matrix-protocol/matrix-protocol-dubbo-core/pom.xml
+1
-1
pom.xml
matrix-protocol/matrix-protocol-dubbo-starter/pom.xml
+1
-1
pom.xml
matrix-protocol/matrix-protocol-web-core/pom.xml
+1
-1
pom.xml
matrix-protocol/matrix-protocol-web-starter/pom.xml
+1
-1
pom.xml
matrix-protocol/pom.xml
+6
-6
pom.xml
pom.xml
+23
-23
No files found.
common-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
common-util/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
config-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
logger-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-bigdata/matrix-bigdata-hbase-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-bigdata
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-bigdata/matrix-bigdata-spark-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-bigdata
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-bigdata/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-bus/matrix-bus-canal-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-bus
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-bus/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-client/matrix-client-openfeign-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-client
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-client/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-datahelper/matrix-datahelper-redis-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-datahelper
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-datahelper/matrix-datahelper-redis-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-datahelper
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-datahelper/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -21,7 +21,7 @@
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datahelper-redis-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
matrix-datasource/matrix-datasource-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-datasource
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-datasource/matrix-datasource-druid/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-datasource
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-datasource/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -21,7 +21,7 @@
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datasource-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
...
...
matrix-gracefulshutdown/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -68,22 +68,22 @@
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!--zookeeper-->
<
dependency
>
<
groupId>
org.apache.dubbo
</groupId
>
<
artifactId>
dubbo-dependencies-zookeeper
</artifactId
>
<
version>
${dubbo-zookper.version}
</version
>
<
type>
pom
</type
>
<
exclusions
>
<
exclusion
>
<
artifactId>
log4j
</artifactId
>
<
groupId>
log4j
</groupId
>
<
/exclusion
>
<
exclusion
>
<
groupId>
org.slf4j
</groupId
>
<
artifactId>
slf4j-log4j12
</artifactId
>
<
/exclusion
>
<
/exclusions
>
<
/dependency
>
<
!--<dependency>--
>
<
!--<groupId>org.apache.dubbo</groupId>--
>
<
!--<artifactId>dubbo-dependencies-zookeeper</artifactId>--
>
<
!--<version>${dubbo-zookper.version}</version>--
>
<
!--<type>pom</type>--
>
<
!--<exclusions>--
>
<
!--<exclusion>--
>
<
!--<artifactId>log4j</artifactId>--
>
<
!--<groupId>log4j</groupId>--
>
<
!--</exclusion>--
>
<
!--<exclusion>--
>
<
!--<groupId>org.slf4j</groupId>--
>
<
!--<artifactId>slf4j-log4j12</artifactId>--
>
<
!--</exclusion>--
>
<
!--</exclusions>--
>
<
!--</dependency>--
>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
...
...
matrix-gracefulshutdown/src/main/java/com/secoo/mall/gracefulshutdown/autoconfigure/MatrixGracefulShutDownAutoConfiguration.java
View file @
5fd29cae
...
...
@@ -67,8 +67,8 @@ public class MatrixGracefulShutDownAutoConfiguration {
@Bean
@ConditionalOnClass
({
ProviderService
.
class
,
RegistryServerSync
.
class
})
@ConditionalOnExpression
(
"!T(org.springframework.util.StringUtils).isEmpty('${dubbo.registry.address:}')"
)
DubboCustomerShutDownHook
createDubboConsumerDownHock
(
ProviderService
providerService
,
RegistryServerSync
registryServerSync
)
{
DubboCustomerShutDownHook
hock
=
new
DubboCustomerShutDownHook
(
providerService
);
DubboCustomerShutDownHook
createDubboConsumerDownHock
(
ProviderService
providerService
,
RegistryServerSync
registryServerSync
,
Environment
env
)
{
DubboCustomerShutDownHook
hock
=
new
DubboCustomerShutDownHook
(
providerService
,
env
);
registryServerSync
.
addObserver
(
hock
);
hock
.
setRegistryServerSync
(
registryServerSync
);
return
hock
;
...
...
@@ -76,8 +76,8 @@ public class MatrixGracefulShutDownAutoConfiguration {
@Bean
@ConditionalOnExpression
(
"!T(org.springframework.util.StringUtils).isEmpty('${dubbo.registry.address:}')"
)
public
RegistryServerSync
createSynObject
(
Registry
registry
)
{
RegistryServerSync
r
=
new
RegistryServerSync
(
registry
);
public
RegistryServerSync
createSynObject
(
Registry
registry
,
Environment
environment
)
{
RegistryServerSync
r
=
new
RegistryServerSync
(
registry
,
environment
);
return
r
;
}
...
...
matrix-gracefulshutdown/src/main/java/com/secoo/mall/gracefulshutdown/component/hook/DubboCustomerShutDownHook.java
View file @
5fd29cae
...
...
@@ -14,13 +14,14 @@ import org.apache.dubbo.common.extension.ExtensionLoader;
import
org.apache.dubbo.common.utils.NetUtils
;
import
org.apache.dubbo.config.DubboShutdownHook
;
import
org.apache.dubbo.registry.Registry
;
import
org.apache.dubbo.registry.nacos.NacosRegistry
;
import
org.apache.dubbo.registry.support.AbstractRegistryFactory
;
import
org.apache.dubbo.registry.zookeeper.ZookeeperRegistry
;
import
org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient
;
import
org.apache.dubbo.rpc.Protocol
;
import
org.apache.dubbo.rpc.model.ApplicationModel
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.core.env.Environment
;
import
java.lang.reflect.Field
;
import
java.text.SimpleDateFormat
;
...
...
@@ -33,6 +34,8 @@ public class DubboCustomerShutDownHook extends AbstractShutDown implements Obser
RegistryServerSync
registryServerSync
;
Environment
env
;
public
RegistryServerSync
getRegistryServerSync
()
{
return
registryServerSync
;
}
...
...
@@ -41,8 +44,9 @@ public class DubboCustomerShutDownHook extends AbstractShutDown implements Obser
this
.
registryServerSync
=
registryServerSync
;
}
public
DubboCustomerShutDownHook
(
ProviderService
providerService
)
{
public
DubboCustomerShutDownHook
(
ProviderService
providerService
,
Environment
env
)
{
this
.
providerService
=
providerService
;
this
.
env
=
env
;
}
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
...
...
@@ -56,7 +60,7 @@ public class DubboCustomerShutDownHook extends AbstractShutDown implements Obser
public
ExecutorDetail
stop
()
{
ExecutorDetail
detail
=
new
ExecutorDetail
();
detail
.
setBeginTime
(
DateUtil
.
getDateTime
());
detail
.
setServiceName
(
"dubboDownHock"
);
detail
.
setServiceName
(
"dubboDownHock
test
"
);
List
<
String
>
str
=
new
ArrayList
<
String
>();
detail
.
setDetail
(
str
);
detail
.
setCode
(
0
);
...
...
@@ -67,15 +71,24 @@ public class DubboCustomerShutDownHook extends AbstractShutDown implements Obser
Collection
<
Registry
>
registries
=
AbstractRegistryFactory
.
getRegistries
();
Set
<
URL
>
urls
=
null
;
List
<
URL
>
checks
=
null
;
ZookeeperRegistry
zookperRegster
=
null
;
if
(
registries
!=
null
&&
registries
.
size
()
>
0
)
{
Iterator
<
Registry
>
iterator
=
registries
.
iterator
();
while
(
iterator
.
hasNext
())
{
Registry
r
=
iterator
.
next
();
zookperRegster
=
(
ZookeeperRegistry
)
r
;
// logger.info(" DubboCustomerShutDownHook ip:{},name :{}, zookperRegstered ,:{}",ip,name,zookperRegster.getRegistered().toString()+StringUtil.line());
if
(
zookperRegster
.
getRegistered
()
!=
null
&&
zookperRegster
.
getRegistered
().
size
()
>
0
)
{
if
(
env
.
getProperty
(
"dubbo.registry.address"
).
contains
(
"nacos"
)){
NacosRegistry
nacosRegistry
=
(
NacosRegistry
)
r
;
if
(
nacosRegistry
.
getRegistered
()
!=
null
&&
nacosRegistry
.
getRegistered
().
size
()>
0
)
{
urls
=
nacosRegistry
.
getRegistered
();
}
}
else
if
(
env
.
getProperty
(
"dubbo.registry.address"
).
contains
(
"zookeeper"
))
{
ZookeeperRegistry
zookperRegster
=
(
ZookeeperRegistry
)
r
;
urls
=
zookperRegster
.
getRegistered
();
}
else
{
logger
.
warn
(
"not support other register exception zookpeeper or naocs "
);
break
;
}
// logger.info(" DubboCustomerShutDownHook ip:{},name :{}, zookperRegstered ,:{}",ip,name,zookperRegster.getRegistered().toString()+StringUtil.line());
// logger.info(" DubboCustomerShutDownHook ip:{},name :{},zookperRegstered urls :{}",ip,name,((urls!=null&&urls.size()>0)?JSON.toJSONString(urls):"url si null")+StringUtil.line());
if
(
urls
!=
null
&&
urls
.
size
()
>
0
)
{
checks
=
new
ArrayList
<
URL
>();
...
...
@@ -83,7 +96,15 @@ public class DubboCustomerShutDownHook extends AbstractShutDown implements Obser
checks
.
add
(
value
);
try
{
logger
.
info
(
"provider url executer ip:{},name :{} unregister before:{} time:{}"
,
ip
,
name
,
value
.
getServiceInterface
()
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
).
format
(
new
Date
())
+
StringUtil
.
line
());
zookperRegster
.
unregister
((
URL
)
value
);
if
(
env
.
getProperty
(
"dubbo.registry.address"
).
contains
(
"nacos"
)){
NacosRegistry
nacosRegistry
=
(
NacosRegistry
)
r
;
nacosRegistry
.
unregister
((
URL
)
value
);
}
else
if
(
env
.
getProperty
(
"dubbo.registry.address"
).
contains
(
"zookeeper"
))
{
ZookeeperRegistry
zookperRegster
=
(
ZookeeperRegistry
)
r
;
zookperRegster
.
unregister
((
URL
)
value
);
}
registryServerSync
.
setSignal
(
true
);
LoggerUtil
.
info
(
"provider url unregister success :"
+
value
.
getServiceInterface
()
+
" time:"
+
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
).
format
(
new
Date
())
+
StringUtil
.
line
());
...
...
@@ -99,17 +120,14 @@ public class DubboCustomerShutDownHook extends AbstractShutDown implements Obser
str
.
add
(
"no serviced registered ip "
+
ip
+
" name :"
+
name
+
StringUtil
.
line
());
detail
.
setCode
(-
1
);
}
break
;
}
}
}
//step3 check检查
if
(
checks
!=
null
&&
checks
.
size
()>
0
)
{
CuratorZookeeperClient
client
=
(
CuratorZookeeperClient
)
getFieldValueByFieldName
(
"zkClient"
,
zookperRegster
);
int
sessionExpireMs
=
client
.
getUrl
().
getParameter
(
"zk.session.expire"
,
6000
);
// CuratorZookeeperClient client = (CuratorZookeeperClient) getFieldValueByFieldName("zkClient", zookperRegster);
// int sessionExpireMs = client.getUrl().getParameter("zk.session.expire", 6000);
int
sessionExpireMs
=
6000
;
//简单,兼容zookeeper
long
startTime
=
System
.
currentTimeMillis
();
//获取开始时间
detail
=
checkNoticed
(
detail
,
str
,
checks
,
sessionExpireMs
);
//通过通知进行检查
long
endTime
=
System
.
currentTimeMillis
();
//获取结束时间
...
...
matrix-gracefulshutdown/src/main/java/com/secoo/mall/gracefulshutdown/monitor/dubbo/service/RegistryServerSync.java
View file @
5fd29cae
...
...
@@ -10,11 +10,13 @@ import org.apache.dubbo.common.json.JSON;
import
org.apache.dubbo.common.utils.StringUtils
;
import
org.apache.dubbo.registry.NotifyListener
;
import
org.apache.dubbo.registry.Registry
;
import
org.apache.dubbo.registry.nacos.NacosRegistry
;
import
org.apache.dubbo.registry.support.AbstractRegistryFactory
;
import
org.apache.dubbo.registry.zookeeper.ZookeeperRegistry
;
import
org.springframework.beans.factory.DisposableBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.core.env.Environment
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
...
...
@@ -23,8 +25,9 @@ import java.util.concurrent.ConcurrentMap;
import
java.util.concurrent.atomic.AtomicLong
;
public
class
RegistryServerSync
extends
Observable
implements
InitializingBean
,
DisposableBean
,
NotifyListener
,
CommandLineRunner
{
public
RegistryServerSync
(
Registry
registry
)
{
public
RegistryServerSync
(
Registry
registry
,
Environment
env
)
{
this
.
registry
=
registry
;
this
.
env
=
env
;
}
private
final
org
.
slf4j
.
Logger
logger
=
org
.
slf4j
.
LoggerFactory
.
getLogger
(
this
.
getClass
());
...
...
@@ -65,6 +68,8 @@ public class RegistryServerSync extends Observable implements InitializingBean,
// }
}
Environment
env
;
//通知处理方法
@Override
public
void
notify
(
List
<
URL
>
urls
)
{
...
...
@@ -154,14 +159,24 @@ public class RegistryServerSync extends Observable implements InitializingBean,
Collection
<
Registry
>
registries
=
AbstractRegistryFactory
.
getRegistries
();
Iterator
<
Registry
>
iterator
=
registries
.
iterator
();
Set
<
URL
>
urls
=
null
;
ZookeeperRegistry
zookperRegster
=
null
;
//
ZookeeperRegistry zookperRegster=null;
while
(
iterator
.
hasNext
())
{
Registry
r
=
iterator
.
next
();
zookperRegster
=
(
ZookeeperRegistry
)
r
;
// logger.info("RegistryServerSync r-------------->"+zookperRegster.getRegistered().toString());
if
(
zookperRegster
.
getRegistered
()
!=
null
&&
zookperRegster
.
getRegistered
().
size
()
>
0
)
{
if
(
env
.
getProperty
(
"dubbo.registry.address"
).
contains
(
"nacos"
)){
NacosRegistry
nacosRegistry
=
(
NacosRegistry
)
r
;
if
(
nacosRegistry
.
getRegistered
()
!=
null
&&
nacosRegistry
.
getRegistered
().
size
()>
0
)
{
urls
=
nacosRegistry
.
getRegistered
();
}
}
else
if
(
env
.
getProperty
(
"dubbo.registry.address"
).
contains
(
"zookeeper"
))
{
ZookeeperRegistry
zookperRegster
=
(
ZookeeperRegistry
)
r
;
urls
=
zookperRegster
.
getRegistered
();
// logger.info("RegistryServerSync urls-------------->"+((urls!=null&&urls.size()>0)?JSON.toJSONString(urls):"url si null"));
}
else
{
logger
.
warn
(
"not support other register exception zookpeeper or naocs "
);
break
;
}
// logger.info("RegistryServerSync urls-------------->"+((urls!=null&&urls.size()>0)?JSON.toJSONString(urls):"url si null"));
if
(
urls
!=
null
&&
urls
.
size
()
>
0
)
{
subscribedUrl
=
new
ArrayList
<
URL
>();
for
(
URL
value:
urls
){
...
...
@@ -178,8 +193,6 @@ public class RegistryServerSync extends Observable implements InitializingBean,
}
}
}
break
;
}
}
...
...
matrix-job/matrix-job-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-job
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-job/matrix-job-xxl-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-job
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-job/matrix-job-xxl-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-job
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-job/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -21,12 +21,12 @@
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-job-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-job-xxl-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo
</groupId>
...
...
matrix-mq/matrix-mq-rocketmq-client/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-mq
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-mq/matrix-mq-rocketmq-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-mq
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-mq/matrix-mq-rocketmq-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-mq
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-mq/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -27,7 +27,7 @@
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mq-rocketmq-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.apache.rocketmq
</groupId>
...
...
matrix-mybatis/matrix-mybatis-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-mybatis
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-mybatis/matrix-mybatis-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-mybatis
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-mybatis/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -25,17 +25,17 @@
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mybatis-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datasource-druid
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mybatis-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
...
...
matrix-protocol/matrix-protocol-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-protocol
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-protocol/matrix-protocol-dubbo-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-protocol
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-protocol/matrix-protocol-dubbo-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-protocol
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-protocol/matrix-protocol-web-core/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-protocol
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-protocol/matrix-protocol-web-starter/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix-protocol
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-protocol/pom.xml
View file @
5fd29cae
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -29,27 +29,27 @@
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-web-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-dubbo-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-web-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-dubbo-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<!-- Aapche Dubbo -->
...
...
pom.xml
View file @
5fd29cae
...
...
@@ -6,7 +6,7 @@
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
<packaging>
pom
</packaging>
...
...
@@ -54,119 +54,119 @@
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
logger-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
common-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
config-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
common-util
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datasource-druid
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mybatis-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mybatis-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mq-rocketmq-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mq-rocketmq-client
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<!--rocketmq-starter废弃,启用matrix-mq-rocketmq-starter-->
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mq-rocketmq-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-dubbo-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-dubbo-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-web-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-protocol-web-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-job-xxl-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-job-xxl-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-bigdata-hbase-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<!--redis-->
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datahelper-redis-core
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datahelper-redis-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-client-openfeign-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<!-- bus -->
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-bus-canal-starter
</artifactId>
<version>
2.0.17
.RELEASE
</version>
<version>
2.0.17
-SNAPSHOT
</version>
</dependency>
<!--普通jar-->
...
...
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