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

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


The following commit(s) were added to refs/heads/master by this push:
     new 238fb46  fix OrderTopicConf (#1187)
238fb46 is described below

commit 238fb46ba007f5a829bacfa847845e27df28aa5a
Author: wsy6543 <[email protected]>
AuthorDate: Tue Aug 19 20:38:27 2025 +0800

    fix OrderTopicConf (#1187)
    
    Co-authored-by: wushengyu <[email protected]>
---
 internal/route.go | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/internal/route.go b/internal/route.go
index 13ce05c..56f764f 100644
--- a/internal/route.go
+++ b/internal/route.go
@@ -19,7 +19,6 @@ package internal
 
 import (
        "context"
-       "github.com/apache/rocketmq-client-go/v2/errors"
        "math/rand"
        "sort"
        "strconv"
@@ -28,13 +27,13 @@ import (
        "sync/atomic"
        "time"
 
-       jsoniter "github.com/json-iterator/go"
-       "github.com/tidwall/gjson"
-
+       "github.com/apache/rocketmq-client-go/v2/errors"
        "github.com/apache/rocketmq-client-go/v2/internal/remote"
        "github.com/apache/rocketmq-client-go/v2/internal/utils"
        "github.com/apache/rocketmq-client-go/v2/primitive"
        "github.com/apache/rocketmq-client-go/v2/rlog"
+       jsoniter "github.com/json-iterator/go"
+       "github.com/tidwall/gjson"
 )
 
 const (
@@ -393,7 +392,7 @@ func (s *namesrvs) queryTopicRouteInfoFromServer(topic 
string) (*TopicRouteData,
                err      error
        )
 
-       //if s.Size() == 0, response will be nil, lead to panic below.
+       // if s.Size() == 0, response will be nil, lead to panic below.
        if s.Size() == 0 {
                rlog.Error("namesrv list empty. UpdateNameServerAddress should 
be called first.", map[string]interface{}{
                        "namesrv": s,
@@ -448,6 +447,9 @@ func (s *namesrvs) topicRouteDataIsChange(oldData 
*TopicRouteData, newData *Topi
        if oldData == nil || newData == nil {
                return true
        }
+       if oldData.OrderTopicConf != newData.OrderTopicConf {
+               return true
+       }
        oldDataCloned := oldData.clone()
        newDataCloned := newData.clone()
 
@@ -542,7 +544,7 @@ func (routeData *TopicRouteData) decode(data string) error {
        if err != nil {
                return err
        }
-
+       routeData.OrderTopicConf = res.Get("orderTopicConf").String()
        bds := res.Get("brokerDatas").Array()
        routeData.BrokerDataList = make([]*BrokerData, len(bds))
        for idx, v := range bds {

Reply via email to