Skip to content

Commit

Permalink
[ISSUE #1076] fix: sort Topic routing information to ensure that orde…
Browse files Browse the repository at this point in the history
…r messages are sent normally

Co-authored-by: dengzhiwen1 <[email protected]>
  • Loading branch information
cserwen and dengzhiwen1 authored Sep 25, 2023
1 parent 5eab91b commit da20ee7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,9 @@ func (s *namesrvs) routeData2PublishInfo(topic string, data *TopicRouteData) *To
}

qds := data.QueueDataList
sort.Slice(qds, func(i, j int) bool {
return i-j >= 0
sort.SliceStable(qds, func(i, j int) bool {
// sort by increase
return strings.Compare(qds[i].BrokerName, qds[j].BrokerName) < 0
})

for _, qd := range qds {
Expand Down

0 comments on commit da20ee7

Please sign in to comment.