You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2020/02/24 02:55:59 UTC

[rocketmq-client-go] branch native updated: fix(consumer): brokerName not found when broker recover from machine crash. (#429)

This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch native
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git


The following commit(s) were added to refs/heads/native by this push:
     new af4067c  fix(consumer): brokerName not found when broker recover from machine crash. (#429)
af4067c is described below

commit af4067cae785c6e632df9f0f5c689e7d5aa86646
Author: xujianhai666 <52...@users.noreply.github.com>
AuthorDate: Mon Feb 24 10:55:51 2020 +0800

    fix(consumer): brokerName not found when broker recover from machine crash. (#429)
    
    when broker recover from machine creash, current routeData is not changed due to bug, which should be "change" as expected. then, mq can not be consumed or consuming mq can not update offset.
---
 internal/route.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/internal/route.go b/internal/route.go
index 8270a8c..a1a3f79 100644
--- a/internal/route.go
+++ b/internal/route.go
@@ -28,7 +28,7 @@ import (
 	"sync/atomic"
 	"time"
 
-	"github.com/json-iterator/go"
+	jsoniter "github.com/json-iterator/go"
 	"github.com/tidwall/gjson"
 
 	"github.com/apache/rocketmq-client-go/v2/internal/remote"
@@ -595,6 +595,10 @@ func (b *BrokerData) Equals(bd *BrokerData) bool {
 		return false
 	}
 
+	if len(b.BrokerAddresses) != len(bd.BrokerAddresses) {
+		return false
+	}
+
 	for k, v := range b.BrokerAddresses {
 		if bd.BrokerAddresses[k] != v {
 			return false