Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
cf71cf88
Commit
cf71cf88
authored
Jun 06, 2018
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : 修复了一个项目没有MQ,graceful-shutdown 启动报错的问题
parent
713c8454
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
35 deletions
+50
-35
pom.xml
brave-spring-boot-starter/pom.xml
+1
-1
pom.xml
commons-core/pom.xml
+1
-1
pom.xml
commons-spring/pom.xml
+7
-2
pom.xml
idgenerator-spring-boot-starter/pom.xml
+1
-1
pom.xml
pom.xml
+2
-2
pom.xml
shutdown-spring-boot-starter/pom.xml
+1
-1
BaseDestroyHandler.java
.../java/cn/quantgroup/tech/shutdown/BaseDestroyHandler.java
+37
-27
No files found.
brave-spring-boot-starter/pom.xml
View file @
cf71cf88
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
commons-parent
</artifactId>
<groupId>
cn.quantgroup
</groupId>
<version>
0.2.5
</version>
<version>
0.2.5
.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
commons-core/pom.xml
View file @
cf71cf88
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
commons-parent
</artifactId>
<groupId>
cn.quantgroup
</groupId>
<version>
0.2.5
</version>
<version>
0.2.5
.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
commons-spring/pom.xml
View file @
cf71cf88
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
commons-parent
</artifactId>
<groupId>
cn.quantgroup
</groupId>
<version>
0.2.5
</version>
<version>
0.2.5
.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -77,7 +77,12 @@
<version>
2.8.8
</version>
<scope>
compile
</scope>
</dependency>
<!--这个可以让我们项目启动速度有质的飞跃-->
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjweaver
</artifactId>
<version>
1.8.13
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
...
...
idgenerator-spring-boot-starter/pom.xml
View file @
cf71cf88
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
commons-parent
</artifactId>
<groupId>
cn.quantgroup
</groupId>
<version>
0.2.5
</version>
<version>
0.2.5
.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
pom.xml
View file @
cf71cf88
...
...
@@ -6,7 +6,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
cn.quantgroup
</groupId>
<artifactId>
commons-parent
</artifactId>
<version>
0.2.5
</version>
<version>
0.2.5
.1
</version>
<parent>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -33,7 +33,7 @@
<lombok.version>
1.16.20
</lombok.version>
<guava.version>
23.0
</guava.version>
<apollo.client.version>
0.10.2
</apollo.client.version>
<common.parent.version>
0.2.5
</common.parent.version>
<common.parent.version>
0.2.5
.1
</common.parent.version>
</properties>
<dependencies>
...
...
shutdown-spring-boot-starter/pom.xml
View file @
cf71cf88
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
commons-parent
</artifactId>
<groupId>
cn.quantgroup
</groupId>
<version>
0.2.5
</version>
<version>
0.2.5
.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
shutdown-spring-boot-starter/src/main/java/cn/quantgroup/tech/shutdown/BaseDestroyHandler.java
View file @
cf71cf88
...
...
@@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.amqp.rabbit.config.RabbitListenerConfigUtils
;
import
org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistry
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.Lifecycle
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -20,6 +21,10 @@ import javax.annotation.PreDestroy;
@Configuration
public
class
BaseDestroyHandler
{
@Configuration
@ConditionalOnClass
(
RabbitListenerEndpointRegistry
.
class
)
public
static
class
DestroyMessageQueueListener
{
@Autowired
private
ApplicationContext
applicationContext
;
...
...
@@ -36,11 +41,6 @@ public class BaseDestroyHandler {
}
}
@PreDestroy
private
void
stopRedisSub
()
{
log
.
info
(
"我什么都没做, redis stopped"
);
}
@PreDestroy
private
void
stopRabbitMQ
()
{
try
{
...
...
@@ -55,4 +55,14 @@ public class BaseDestroyHandler {
}
log
.
info
(
"MQ listener stopped"
);
}
}
@PreDestroy
private
void
stopOther
()
{
log
.
info
(
"我什么都没做, other stopped"
);
}
}
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