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
a3f37a4a
Commit
a3f37a4a
authored
Aug 05, 2019
by
QIANGLU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增redis基础组件
parent
4961ce50
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
6 deletions
+54
-6
ApolloContextInitializer.java
config-starter/src/main/java/com/secoo/mall/config/internals/ApolloContextInitializer.java
+1
-1
pom.xml
redis-starter/pom.xml
+12
-5
MatrixeRedisAutoConfiguration.java
redis-starter/src/main/java/com/secoo/mall/redis/config/MatrixeRedisAutoConfiguration.java
+37
-0
RedefineClusterUtils.java
redis-starter/src/main/java/com/secoo/mall/redis/utils/RedefineClusterUtils.java
+0
-0
spring.factories
redis-starter/src/resources/META-INF/spring.factories
+4
-0
No files found.
config-starter/src/main/java/com/secoo/mall/config/internals/ApolloContextInitializer.java
View file @
a3f37a4a
...
...
@@ -26,7 +26,7 @@ public class ApolloContextInitializer implements ApplicationContextInitializer<C
if
(!
StringUtils
.
isEmpty
(
appId
))
{
System
.
setProperty
(
"app.id"
,
appId
);
System
.
setProperty
(
"apollo.cacheDir"
,
cacheDir
);
System
.
setProperty
(
"apollo.bootstrap.enabled"
,
"true"
);
System
.
setProperty
(
"apollo.bootstrap.e
agerLoad.e
nabled"
,
"true"
);
}
}
...
...
redis-starter/pom.xml
View file @
a3f37a4a
...
...
@@ -10,19 +10,25 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
redis-starter
</artifactId>
<dependencies>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
common-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-pool2
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
</dependency>
</dependencies>
</project>
\ No newline at end of file
redis-starter/src/main/java/com/secoo/mall/redis/config/MatrixeRedisAutoConfiguration.java
0 → 100755
View file @
a3f37a4a
package
com
.
secoo
.
mall
.
redis
.
config
;
import
com.secoo.mall.redis.utils.RedefineClusterUtils
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
/**
* Created by QIANG
*
* @author QIANG
*/
@Configuration
public
class
MatrixeRedisAutoConfiguration
{
@Bean
@ConditionalOnMissingBean
(
name
=
"redisTemplate"
)
public
RedisTemplate
<
Object
,
Object
>
redisTemplate
(
RedisConnectionFactory
redisConnectionFactory
)
{
RedisTemplate
<
Object
,
Object
>
template
=
new
RedisTemplate
<>();
template
.
setConnectionFactory
(
redisConnectionFactory
);
template
.
setDefaultSerializer
(
new
StringRedisSerializer
());
return
template
;
}
@Bean
@ConditionalOnMissingBean
(
RedefineClusterUtils
.
class
)
public
RedefineClusterUtils
jedisClusterUtils
()
{
return
new
RedefineClusterUtils
();
}
}
redis-starter/src/main/java/com/secoo/mall/redis/utils/RedefineClusterUtils.java
0 → 100755
View file @
a3f37a4a
This diff is collapsed.
Click to expand it.
redis-starter/src/resources/META-INF/spring.factories
0 → 100755
View file @
a3f37a4a
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.secoo.mall.redis.config.MatrixeRedisAutoConfiguration
\ No newline at end of file
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