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
d203f8cf
Commit
d203f8cf
authored
May 05, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消除成功接收处理
parent
82a9ab7e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
26 deletions
+30
-26
MessageService.java
.../main/java/com/yanzuoguang/mq/service/MessageService.java
+0
-8
MqService.java
...q/src/main/java/com/yanzuoguang/mq/service/MqService.java
+10
-0
MessageServiceImpl.java
...a/com/yanzuoguang/mq/service/impl/MessageServiceImpl.java
+0
-18
MqServiceImpl.java
...n/java/com/yanzuoguang/mq/service/impl/MqServiceImpl.java
+20
-0
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/MessageService.java
View file @
d203f8cf
...
...
@@ -50,12 +50,4 @@ public interface MessageService {
* @param messageVo
*/
String
onError
(
MessageVo
messageVo
);
/**
* 消息收到确认
*
* @param message 收到的消息
* @param channel 收到的通道
*/
void
basicAck
(
Message
message
,
Channel
channel
);
}
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/MqService.java
View file @
d203f8cf
package
com
.
yanzuoguang
.
mq
.
service
;
import
com.rabbitmq.client.Channel
;
import
com.yanzuoguang.mq.vo.MessageVo
;
import
com.yanzuoguang.mq.vo.QueueVo
;
import
com.yanzuoguang.mq.vo.req.QueueQueryReqVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.amqp.core.Message
;
/**
* 消息队列服务
...
...
@@ -47,4 +49,12 @@ public interface MqService {
* @return
*/
String
message_error
(
MessageVo
req
);
/**
* 消息收到确认
*
* @param message 收到的消息
* @param channel 收到的通道
*/
void
basicAck
(
Message
message
,
Channel
channel
);
}
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MessageServiceImpl.java
View file @
d203f8cf
package
com
.
yanzuoguang
.
mq
.
service
.
impl
;
import
com.rabbitmq.client.Channel
;
import
com.yanzuoguang.mq.base.MyRabbitTemplate
;
import
com.yanzuoguang.mq.dao.MessageDao
;
import
com.yanzuoguang.mq.service.MessageService
;
import
com.yanzuoguang.mq.vo.MessageVo
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.log.Log
;
import
org.springframework.amqp.AmqpException
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.core.MessageDeliveryMode
;
...
...
@@ -18,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -159,19 +156,4 @@ public class MessageServiceImpl implements MessageService {
return
messageVo
.
getMessageId
();
}
/**
* 消息收到确认
*
* @param message 收到的消息
* @param channel 收到的通道
*/
@Override
public
void
basicAck
(
Message
message
,
Channel
channel
)
{
try
{
channel
.
basicAck
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
);
}
catch
(
IOException
e
)
{
Log
.
error
(
MessageServiceImpl
.
class
,
e
);
}
}
}
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MqServiceImpl.java
View file @
d203f8cf
package
com
.
yanzuoguang
.
mq
.
service
.
impl
;
import
com.rabbitmq.client.Channel
;
import
com.yanzuoguang.mq.service.MessageService
;
import
com.yanzuoguang.mq.service.MqService
;
import
com.yanzuoguang.mq.service.QueueService
;
import
com.yanzuoguang.mq.vo.MessageVo
;
import
com.yanzuoguang.mq.vo.QueueVo
;
import
com.yanzuoguang.mq.vo.req.QueueQueryReqVo
;
import
com.yanzuoguang.util.log.Log
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
@Component
public
class
MqServiceImpl
implements
MqService
{
...
...
@@ -71,4 +76,19 @@ public class MqServiceImpl implements MqService {
req
.
check
();
return
messageService
.
onError
(
req
);
}
/**
* 消息收到确认
*
* @param message 收到的消息
* @param channel 收到的通道
*/
@Override
public
void
basicAck
(
Message
message
,
Channel
channel
)
{
try
{
channel
.
basicAck
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
);
}
catch
(
IOException
e
)
{
Log
.
error
(
MessageServiceImpl
.
class
,
e
);
}
}
}
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