drpmma commented on code in PR #5611:
URL: https://github.com/apache/rocketmq/pull/5611#discussion_r1039296828
##########
broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java:
##########
@@ -586,9 +587,35 @@ private long popMsgFromQueue(boolean isRetry,
GetMessageResult getMessageResult,
} finally {
queueLockManager.unLock(lockKey);
}
+
if (getMessageTmpResult != null) {
+ String brokerName =
brokerController.getBrokerConfig().getBrokerName();
for (SelectMappedBufferResult mapedBuffer :
getMessageTmpResult.getMessageMapedList()) {
- getMessageResult.addMessage(mapedBuffer);
+ // We should not recode buffer for normal topic message
+ if (!isRetry) {
+ getMessageResult.addMessage(mapedBuffer);
+ } else {
+ List<MessageExt> messageExtList =
MessageDecoder.decodesBatch(mapedBuffer.getByteBuffer(),
+ true, false, true);
+ mapedBuffer.release();
+ for (MessageExt messageExt : messageExtList) {
+ try {
+ String ckInfo =
ExtraInfoUtil.buildExtraInfo(offset, popTime, requestHeader.getInvisibleTime(),
+ reviveQid, messageExt.getTopic(), brokerName,
messageExt.getQueueId(), messageExt.getQueueOffset());
+
messageExt.getProperties().putIfAbsent(MessageConst.PROPERTY_POP_CK, ckInfo);
+ messageExt.setTopic(requestHeader.getTopic());
Review Comment:
It's recommended to add some annotations about replacing the message retry
topic with its original topic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]