Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
support standard json
  • Loading branch information
yuz10 authored Jun 16, 2022
commit f0ef089e1c02af305841dc7dd71592c3b2f49c62
3 changes: 2 additions & 1 deletion internal/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we deserialize JSON string in a standard way? Make the SDK could handle both the two formats.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid we cant use the standard way because the json is not standard, the change have already handled both stardard hand non-stardard formats

bd.BrokerAddresses[id] = strings.Replace(str[i+1:], "\"", "", -1)
}
}
Expand Down