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
de3a3983
Commit
de3a3983
authored
Aug 09, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实例化关系
parent
40a67046
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
MessageServeServiceImpl.java
.../yanzuoguang/mq/service/impl/MessageServeServiceImpl.java
+4
-7
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MessageServeServiceImpl.java
View file @
de3a3983
...
...
@@ -2,7 +2,6 @@ package com.yanzuoguang.mq.service.impl;
import
com.alibaba.fastjson.TypeReference
;
import
com.rabbitmq.client.Channel
;
import
com.yanzuoguang.mq.base.MqConsumeDynamic
;
import
com.yanzuoguang.mq.dao.QueueServerDao
;
import
com.yanzuoguang.mq.dao.QueueServerTokenDao
;
import
com.yanzuoguang.mq.plan.YzgMqProcedure
;
...
...
@@ -46,9 +45,7 @@ public class MessageServeServiceImpl implements MessageServerService, Initializi
@Autowired
private
QueueServerTokenDao
queueServerTokenDao
;
@Autowired
private
MqConsumeDynamic
mqConsumeDynamic
;
@Autowired
private
MessageSendService
sendService
;
private
MessageSendService
messageSendService
;
@Autowired
private
YzgMqProcedure
yzgMqProcedure
;
...
...
@@ -141,7 +138,7 @@ public class MessageServeServiceImpl implements MessageServerService, Initializi
// 创建延迟队列和主队列的关系
queueService
.
create
(
new
QueueVo
(
localQueueName
,
localQueueName
,
localQueueName
,
req
.
getServerWaitTime
(),
queueName
,
queueName
,
queueName
));
this
.
m
qConsumeDynamic
.
init
(
queueName
,
concurrency
,
new
ChannelAwareMessageListener
()
{
this
.
m
essageSendService
.
init
(
queueName
,
concurrency
,
new
ChannelAwareMessageListener
()
{
@Override
public
void
onMessage
(
Message
message
,
Channel
channel
)
throws
Exception
{
String
json
=
new
String
(
message
.
getBody
());
...
...
@@ -153,7 +150,7 @@ public class MessageServeServiceImpl implements MessageServerService, Initializi
}
catch
(
Exception
ex
)
{
Log
.
error
(
MqServiceImpl
.
class
,
ex
);
}
finally
{
s
endService
.
basicAck
(
message
,
channel
);
messageS
endService
.
basicAck
(
message
,
channel
);
}
}
});
...
...
@@ -175,7 +172,7 @@ public class MessageServeServiceImpl implements MessageServerService, Initializi
this
.
registerServerToken
(
to
);
// 设置延迟队列的回调函数
this
.
m
qConsumeDynamic
.
init
(
localQueueName
,
concurrency
,
listener
);
this
.
m
essageSendService
.
init
(
localQueueName
,
concurrency
,
listener
);
return
localQueueName
;
}
...
...
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