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
7d35fcd5
Commit
7d35fcd5
authored
Aug 16, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级新版本
parent
60d61cb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
MqService.java
...q/src/main/java/com/yanzuoguang/mq/service/MqService.java
+15
-3
MqServiceImpl.java
...n/java/com/yanzuoguang/mq/service/impl/MqServiceImpl.java
+8
-0
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/MqService.java
View file @
7d35fcd5
...
@@ -66,7 +66,19 @@ public interface MqService {
...
@@ -66,7 +66,19 @@ public interface MqService {
/**
/**
* 消息收到确认
* 消息收到确认,出错时不需要重发
*
* @param messageBody 消息体
* @param channel 收到的通道
* @param message 消息内容
* @param consumerMessage 消费者,具体业务处理函数
*/
@ApiOperation
(
value
=
"消息收到确认"
)
void
basicHandle
(
Message
messageBody
,
Channel
channel
,
String
message
,
Consumer
<
String
>
consumerMessage
);
/**
* 消息收到确认,出错时重发
*
*
* @param messageBody 消息体
* @param messageBody 消息体
* @param channel 收到的通道
* @param channel 收到的通道
...
@@ -79,7 +91,7 @@ public interface MqService {
...
@@ -79,7 +91,7 @@ public interface MqService {
/**
/**
* 消息收到确认
* 消息收到确认
,出错时重发
*
*
* @param messageBody 消息体
* @param messageBody 消息体
* @param channel 收到的通道
* @param channel 收到的通道
...
@@ -92,7 +104,7 @@ public interface MqService {
...
@@ -92,7 +104,7 @@ public interface MqService {
void
basicHandle
(
Message
messageBody
,
Channel
channel
,
String
exchangeNameAndRouteKey
,
String
message
,
long
dedTime
,
Consumer
<
String
>
consumerMessage
);
void
basicHandle
(
Message
messageBody
,
Channel
channel
,
String
exchangeNameAndRouteKey
,
String
message
,
long
dedTime
,
Consumer
<
String
>
consumerMessage
);
/**
/**
* 消息收到确认
* 消息收到确认
,出错时重发
*
*
* @param messageBody 消息体
* @param messageBody 消息体
* @param channel 收到的通道
* @param channel 收到的通道
...
...
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MqServiceImpl.java
View file @
7d35fcd5
...
@@ -105,6 +105,11 @@ public class MqServiceImpl implements MqService {
...
@@ -105,6 +105,11 @@ public class MqServiceImpl implements MqService {
messageSendService
.
basicAck
(
message
,
channel
);
messageSendService
.
basicAck
(
message
,
channel
);
}
}
@Override
public
void
basicHandle
(
Message
messageBody
,
Channel
channel
,
String
message
,
Consumer
<
String
>
consumerMessage
)
{
this
.
basicHandle
(
messageBody
,
channel
,
StringHelper
.
EMPTY
,
StringHelper
.
EMPTY
,
message
,
0
,
consumerMessage
);
}
@Override
@Override
public
void
basicHandle
(
Message
messageBody
,
Channel
channel
,
String
exchangeNameAndRouteKey
,
String
message
,
Consumer
<
String
>
consumerMessage
)
{
public
void
basicHandle
(
Message
messageBody
,
Channel
channel
,
String
exchangeNameAndRouteKey
,
String
message
,
Consumer
<
String
>
consumerMessage
)
{
this
.
basicHandle
(
messageBody
,
channel
,
exchangeNameAndRouteKey
,
exchangeNameAndRouteKey
,
message
,
60
*
1000
,
consumerMessage
);
this
.
basicHandle
(
messageBody
,
channel
,
exchangeNameAndRouteKey
,
exchangeNameAndRouteKey
,
message
,
60
*
1000
,
consumerMessage
);
...
@@ -123,6 +128,9 @@ public class MqServiceImpl implements MqService {
...
@@ -123,6 +128,9 @@ public class MqServiceImpl implements MqService {
Log
.
error
(
MqServiceImpl
.
class
,
e
);
Log
.
error
(
MqServiceImpl
.
class
,
e
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
Log
.
error
(
MqServiceImpl
.
class
,
e
);
Log
.
error
(
MqServiceImpl
.
class
,
e
);
if
(
StringHelper
.
isEmpty
(
exchangeName
,
routeKey
))
{
return
;
}
this
.
message
(
new
MessageVo
(
exchangeName
,
routeKey
,
message
,
dedTime
));
this
.
message
(
new
MessageVo
(
exchangeName
,
routeKey
,
message
,
dedTime
));
}
finally
{
}
finally
{
this
.
basicAck
(
messageBody
,
channel
);
this
.
basicAck
(
messageBody
,
channel
);
...
...
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