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
e97e8409
Commit
e97e8409
authored
Jan 12, 2022
by
郑冰晶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.1.5支持redis集群拓扑刷新
parent
18ea8cd1
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
75 additions
and
26 deletions
+75
-26
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
elasticsearch-starter/pom.xml
+1
-1
pom.xml
logger-starter/pom.xml
+1
-1
pom.xml
mongodb-starter/pom.xml
+1
-1
pom.xml
monitor-starter/pom.xml
+1
-1
pom.xml
mybatis-starter/pom.xml
+1
-1
pom.xml
openfeign-starter/pom.xml
+1
-1
pom.xml
pom.xml
+13
-13
pom.xml
protocol-starter/pom.xml
+1
-1
pom.xml
redis-starter/pom.xml
+1
-1
MatrixLettuceClientConfigurationBuilderCustomizer.java
redis-starter/src/main/java/com/secoo/mall/redis/config/MatrixLettuceClientConfigurationBuilderCustomizer.java
+39
-0
MatrixeRedisAutoConfiguration.java
redis-starter/src/main/java/com/secoo/mall/redis/config/MatrixeRedisAutoConfiguration.java
+11
-1
pom.xml
rocketmq-starter/pom.xml
+1
-1
No files found.
common-core/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
common-util/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
config-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
elasticsearch-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
logger-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
mongodb-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
monitor-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
mybatis-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
openfeign-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
pom.xml
View file @
e97e8409
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
...
@@ -45,62 +45,62 @@
...
@@ -45,62 +45,62 @@
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
logger-starter
</artifactId>
<artifactId>
logger-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
monitor-starter
</artifactId>
<artifactId>
monitor-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
common-core
</artifactId>
<artifactId>
common-core
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
config-starter
</artifactId>
<artifactId>
config-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
common-util
</artifactId>
<artifactId>
common-util
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
redis-starter
</artifactId>
<artifactId>
redis-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
mybatis-starter
</artifactId>
<artifactId>
mybatis-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
mongodb-starter
</artifactId>
<artifactId>
mongodb-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
elasticsearch-starter
</artifactId>
<artifactId>
elasticsearch-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
protocol-starter
</artifactId>
<artifactId>
protocol-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
rocketmq-starter
</artifactId>
<artifactId>
rocketmq-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
openfeign-starter
</artifactId>
<artifactId>
openfeign-starter
</artifactId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
protocol-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
redis-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
redis-starter/src/main/java/com/secoo/mall/redis/config/MatrixLettuceClientConfigurationBuilderCustomizer.java
0 → 100644
View file @
e97e8409
package
com
.
secoo
.
mall
.
redis
.
config
;
import
io.lettuce.core.ClientOptions
;
import
io.lettuce.core.TimeoutOptions
;
import
io.lettuce.core.cluster.ClusterClientOptions
;
import
io.lettuce.core.cluster.ClusterTopologyRefreshOptions
;
import
org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer
;
import
org.springframework.boot.autoconfigure.data.redis.RedisProperties
;
import
org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration
;
import
java.time.Duration
;
public
class
MatrixLettuceClientConfigurationBuilderCustomizer
implements
LettuceClientConfigurationBuilderCustomizer
{
private
final
RedisProperties
properties
;
private
final
Boolean
adapt
;
private
final
Duration
period
;
MatrixLettuceClientConfigurationBuilderCustomizer
(
RedisProperties
properties
,
Boolean
adapt
,
Duration
period
)
{
this
.
properties
=
properties
;
this
.
adapt
=
adapt
;
this
.
period
=
period
;
}
@Override
public
void
customize
(
LettuceClientConfiguration
.
LettuceClientConfigurationBuilder
clientConfigurationBuilder
)
{
ClientOptions
.
Builder
builder
=
ClientOptions
.
builder
();
if
(
this
.
properties
.
getCluster
()
!=
null
)
{
ClusterTopologyRefreshOptions
.
Builder
refreshBuilder
=
ClusterTopologyRefreshOptions
.
builder
();
if
(
this
.
period
!=
null
)
{
refreshBuilder
.
enablePeriodicRefresh
(
this
.
period
);
}
if
(
this
.
adapt
!=
null
&&
this
.
adapt
)
{
refreshBuilder
.
enableAllAdaptiveRefreshTriggers
();
}
builder
=
ClusterClientOptions
.
builder
().
topologyRefreshOptions
(
refreshBuilder
.
build
());
}
clientConfigurationBuilder
.
clientOptions
(
builder
.
timeoutOptions
(
TimeoutOptions
.
enabled
()).
build
());
}
}
redis-starter/src/main/java/com/secoo/mall/redis/config/MatrixeRedisAutoConfiguration.java
View file @
e97e8409
...
@@ -2,13 +2,18 @@ package com.secoo.mall.redis.config;
...
@@ -2,13 +2,18 @@ package com.secoo.mall.redis.config;
import
com.secoo.mall.redis.utils.MatrixRedisClusterUtils
;
import
com.secoo.mall.redis.utils.MatrixRedisClusterUtils
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer
;
import
org.springframework.boot.autoconfigure.data.redis.RedisProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.env.Environment
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
import
java.time.Duration
;
/**
/**
* Created by QIANG
* Created by QIANG
...
@@ -36,5 +41,10 @@ public class MatrixeRedisAutoConfiguration {
...
@@ -36,5 +41,10 @@ public class MatrixeRedisAutoConfiguration {
return
new
MatrixRedisClusterUtils
();
return
new
MatrixRedisClusterUtils
();
}
}
@Bean
public
LettuceClientConfigurationBuilderCustomizer
customizer
(
RedisProperties
properties
,
Environment
env
)
{
Duration
period
=
env
.
getProperty
(
"spring.redis.lettuce.cluster.refresh.period"
,
Duration
.
class
);
Boolean
adapt
=
env
.
getProperty
(
"spring.redis.lettuce.cluster.refresh.adaptive"
,
Boolean
.
class
,
Boolean
.
FALSE
);
return
new
MatrixLettuceClientConfigurationBuilderCustomizer
(
properties
,
adapt
,
period
);
}
}
}
rocketmq-starter/pom.xml
View file @
e97e8409
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.5.RELEASE
</version>
<version>
1.1.5
-eh1
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
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