You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by yu...@apache.org on 2022/06/16 14:11:40 UTC

[rocketmq-client-go] 01/01: support standard json

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

yuzhou pushed a commit to branch yuz10-patch-1
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git

commit f0ef089e1c02af305841dc7dd71592c3b2f49c62
Author: yuz10 <84...@qq.com>
AuthorDate: Thu Jun 16 22:11:35 2022 +0800

    support standard json
---
 internal/route.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/internal/route.go b/internal/route.go
index a101a61..715c64f 100644
--- a/internal/route.go
+++ b/internal/route.go
@@ -558,7 +558,8 @@ func (routeData *TopicRouteData) decode(data string) error {
 				if i < 0 {
 					continue
 				}
-				id, _ := strconv.ParseInt(str[0:i], 10, 64)
+				brokerId := strings.ReplaceAll(str[0:i], "\"", "")
+				id, _ := strconv.ParseInt(brokerId, 10, 64)
 				bd.BrokerAddresses[id] = strings.Replace(str[i+1:], "\"", "", -1)
 			}
 		}