Skip to content

Commit 238fb46

Browse files
wsy6543wushengyu
andauthored
fix OrderTopicConf (apache#1187)
Co-authored-by: wushengyu <wushengyu@shizhuang-inc.com>
1 parent 67ec50b commit 238fb46

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

internal/route.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package internal
1919

2020
import (
2121
"context"
22-
"github.com/apache/rocketmq-client-go/v2/errors"
2322
"math/rand"
2423
"sort"
2524
"strconv"
@@ -28,13 +27,13 @@ import (
2827
"sync/atomic"
2928
"time"
3029

31-
jsoniter "github.com/json-iterator/go"
32-
"github.com/tidwall/gjson"
33-
30+
"github.com/apache/rocketmq-client-go/v2/errors"
3431
"github.com/apache/rocketmq-client-go/v2/internal/remote"
3532
"github.com/apache/rocketmq-client-go/v2/internal/utils"
3633
"github.com/apache/rocketmq-client-go/v2/primitive"
3734
"github.com/apache/rocketmq-client-go/v2/rlog"
35+
jsoniter "github.com/json-iterator/go"
36+
"github.com/tidwall/gjson"
3837
)
3938

4039
const (
@@ -393,7 +392,7 @@ func (s *namesrvs) queryTopicRouteInfoFromServer(topic string) (*TopicRouteData,
393392
err error
394393
)
395394

396-
//if s.Size() == 0, response will be nil, lead to panic below.
395+
// if s.Size() == 0, response will be nil, lead to panic below.
397396
if s.Size() == 0 {
398397
rlog.Error("namesrv list empty. UpdateNameServerAddress should be called first.", map[string]interface{}{
399398
"namesrv": s,
@@ -448,6 +447,9 @@ func (s *namesrvs) topicRouteDataIsChange(oldData *TopicRouteData, newData *Topi
448447
if oldData == nil || newData == nil {
449448
return true
450449
}
450+
if oldData.OrderTopicConf != newData.OrderTopicConf {
451+
return true
452+
}
451453
oldDataCloned := oldData.clone()
452454
newDataCloned := newData.clone()
453455

@@ -542,7 +544,7 @@ func (routeData *TopicRouteData) decode(data string) error {
542544
if err != nil {
543545
return err
544546
}
545-
547+
routeData.OrderTopicConf = res.Get("orderTopicConf").String()
546548
bds := res.Get("brokerDatas").Array()
547549
routeData.BrokerDataList = make([]*BrokerData, len(bds))
548550
for idx, v := range bds {

0 commit comments

Comments
 (0)