Commit 08992b44 by Future

日志注释

parent 9ccba4b1
...@@ -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);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment