Fizell commented on code in PR #6724:
URL: https://github.com/apache/rocketmq/pull/6724#discussion_r2079575652


##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/heartbeat/HeartbeatData.java:
##########
@@ -53,9 +56,38 @@ public void setConsumerDataSet(Set<ConsumerData> 
consumerDataSet) {
         this.consumerDataSet = consumerDataSet;
     }
 
+    public int getHeartbeatFingerprint() {
+        return heartbeatFingerprint;
+    }
+
+    public void setHeartbeatFingerprint(int heartbeatFingerprint) {
+        this.heartbeatFingerprint = heartbeatFingerprint;
+    }
+
+    public boolean isWithoutSub() {
+        return isWithoutSub;
+    }
+
+    public void setWithoutSub(boolean withoutSub) {
+        isWithoutSub = withoutSub;
+    }
+
     @Override
     public String toString() {
         return "HeartbeatData [clientID=" + clientID + ", producerDataSet=" + 
producerDataSet
             + ", consumerDataSet=" + consumerDataSet + "]";
     }
+
+    public int computeHeartbeatFingerprint() {
+        HeartbeatData heartbeatDataCopy = 
JSON.parseObject(JSON.toJSONString(this), HeartbeatData.class);

Review Comment:
   this method of compute hash values ​​does not seem to be correct, because 
the order of the producerDataSet and consumerDataSet after serialization cannot 
be guaranteed to be unique



##########
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java:
##########
@@ -671,7 +774,9 @@ private HeartbeatData prepareHeartbeatData() {
                 consumerData.setConsumeFromWhere(impl.consumeFromWhere());
                 
consumerData.getSubscriptionDataSet().addAll(impl.subscriptions());

Review Comment:
   should this line of code be deleted?



-- 
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: commits-unsubscr...@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to