未验证 提交 d03e46a4 编写于 作者: U uglycow 提交者: GitHub

[ISSUE #1771]add MessageExt.getBrokerName for issue (#1772)

* typo fix

* add MessageExt.getBrokerName()

* add brokerName for toString

* get brokerName  from mq
上级 689e7706
......@@ -104,6 +104,7 @@ public class PullAPIWrapper {
Long.toString(pullResult.getMinOffset()));
MessageAccessor.putProperty(msg, MessageConst.PROPERTY_MAX_OFFSET,
Long.toString(pullResult.getMaxOffset()));
msg.setBrokerName(mq.getBrokerName());
}
pullResultExt.setMsgFoundList(msgListFilterAgain);
......
......@@ -27,6 +27,8 @@ import org.apache.rocketmq.common.sysflag.MessageSysFlag;
public class MessageExt extends Message {
private static final long serialVersionUID = 5720810158625748049L;
private String brokerName;
private int queueId;
private int storeSize;
......@@ -107,6 +109,14 @@ public class MessageExt extends Message {
return socketAddress2ByteBuffer(this.storeHost, byteBuffer);
}
public String getBrokerName() {
return brokerName;
}
public void setBrokerName(String brokerName) {
this.brokerName = brokerName;
}
public int getQueueId() {
return queueId;
}
......@@ -235,7 +245,7 @@ public class MessageExt extends Message {
@Override
public String toString() {
return "MessageExt [queueId=" + queueId + ", storeSize=" + storeSize + ", queueOffset=" + queueOffset
return "MessageExt [brokerName=" + brokerName + ", queueId=" + queueId + ", storeSize=" + storeSize + ", queueOffset=" + queueOffset
+ ", sysFlag=" + sysFlag + ", bornTimestamp=" + bornTimestamp + ", bornHost=" + bornHost
+ ", storeTimestamp=" + storeTimestamp + ", storeHost=" + storeHost + ", msgId=" + msgId
+ ", commitLogOffset=" + commitLogOffset + ", bodyCRC=" + bodyCRC + ", reconsumeTimes="
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册