Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
2975ef98
Commit
2975ef98
authored
Sep 04, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改MQ请求尸体,防止出错
parent
0252e680
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
YzgMqConsumer.java
.../src/main/java/com/yanzuoguang/mq/plan/YzgMqConsumer.java
+18
-1
MqServiceImpl.java
...n/java/com/yanzuoguang/mq/service/impl/MqServiceImpl.java
+1
-1
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/plan/YzgMqConsumer.java
View file @
2975ef98
...
...
@@ -11,6 +11,7 @@ import com.yanzuoguang.util.helper.StringHelper;
import
com.yanzuoguang.util.log.Log
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -23,7 +24,7 @@ import java.util.Map;
* @author 颜佐光
*/
@Component
public
class
YzgMqConsumer
{
public
class
YzgMqConsumer
implements
InitializingBean
{
private
static
class
TimeUnit
{
public
String
tag
;
...
...
@@ -66,6 +67,22 @@ public class YzgMqConsumer {
private
Map
<
String
,
Boolean
>
cacheQueueName
=
new
HashMap
<>();
/**
* Invoked by a BeanFactory after it has set all bean properties supplied
* (and satisfied BeanFactoryAware and ApplicationContextAware).
* <p>This method allows the bean instance to perform initialization only
* possible when all bean properties have been set and to throw an
* exception in the event of misconfiguration.
*
* @throws Exception in the event of misconfiguration (such
* as failure to set an essential property) or if initialization fails.
*/
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
mqService
.
createQueue
(
new
QueueVo
(
YZG_MQ_SYSTEM_QUEUE
));
}
/**
* MQ回调
*
...
...
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MqServiceImpl.java
View file @
2975ef98
...
...
@@ -79,7 +79,7 @@ public class MqServiceImpl implements MqService, InitializingBean {
}
this
.
localName
=
UrlHelper
.
getIp
();
QueueVo
removeToken
=
new
QueueVo
(
YzgMqConsumer
.
YZG_MQ_CLEAR_TOKEN_QUEUE
,
YzgMqConsumer
.
YZG_MQ_CLEAR_TOKEN_QUEUE
,
YzgMqConsumer
.
YZG_MQ_CLEAR_TOKEN_QUEUE
);
QueueVo
removeToken
=
new
QueueVo
(
YzgMqConsumer
.
YZG_MQ_CLEAR_TOKEN_QUEUE
);
removeToken
.
check
();
queueService
.
create
(
removeToken
);
...
...
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