Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
08992b44
Commit
08992b44
authored
Sep 27, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志注释
parent
9ccba4b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
core/src/main/java/com/wecloud/im/mq/RocketMqProducerService.java
+7
-8
No files found.
core/src/main/java/com/wecloud/im/mq/RocketMqProducerService.java
View file @
08992b44
...
@@ -13,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -13,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
/**
/**
* @Author wenzhida
* @Author wenzhida
...
@@ -206,21 +205,21 @@ public class RocketMqProducerService implements SendCallback {
...
@@ -206,21 +205,21 @@ public class RocketMqProducerService implements SendCallback {
* 打印消息topic等参数方便后续查找问题
* 打印消息topic等参数方便后续查找问题
*/
*/
private
void
logMsg
(
Message
message
,
SendResult
sendResult
)
{
private
void
logMsg
(
Message
message
,
SendResult
sendResult
)
{
LOGGER
.
info
(
"消息队列发送完成:topic={},tag={},msgId={},sendResult={}"
,
message
.
getTopic
(),
//
LOGGER.info("消息队列发送完成:topic={},tag={},msgId={},sendResult={}", message.getTopic(),
message
.
getTags
(),
message
.
getKeys
(),
Objects
.
nonNull
(
sendResult
)
?
sendResult
:
" result is null"
);
//
message.getTags(), message.getKeys(), Objects.nonNull(sendResult) ? sendResult : " result is null");
}
}
class
RocketSendCallback
implements
SendCallback
{
class
RocketSendCallback
implements
SendCallback
{
@Override
@Override
public
void
onSuccess
(
SendResult
sendResult
)
{
public
void
onSuccess
(
SendResult
sendResult
)
{
LOGGER
.
info
(
"send message success. topic={} msgId={}"
,
//
LOGGER.info("send message success. topic={} msgId={}",
sendResult
.
getMessageQueue
().
getTopic
(),
sendResult
.
getMsgId
());
//
sendResult.getMessageQueue().getTopic(), sendResult.getMsgId());
}
}
@Override
@Override
public
void
onException
(
Throwable
e
)
{
public
void
onException
(
Throwable
e
)
{
LOGGER
.
error
(
"send message failed."
,
e
);
//
LOGGER.error("send message failed.", e);
}
}
}
}
...
@@ -228,9 +227,9 @@ public class RocketMqProducerService implements SendCallback {
...
@@ -228,9 +227,9 @@ public class RocketMqProducerService implements SendCallback {
public
void
onException
(
Throwable
e
)
{
public
void
onException
(
Throwable
e
)
{
if
(
e
instanceof
MqContextException
)
{
if
(
e
instanceof
MqContextException
)
{
MqContextException
context
=
(
MqContextException
)
e
;
MqContextException
context
=
(
MqContextException
)
e
;
LOGGER
.
error
(
"send message failed. topic="
+
context
.
getTopic
()
+
", msgId="
+
context
.
getMessageId
());
//
LOGGER.error("send message failed. topic=" + context.getTopic() + ", msgId=" + context.getMessageId());
}
else
{
}
else
{
LOGGER
.
error
(
"send message failed. ="
+
e
);
//
LOGGER.error("send message failed. =" + 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