You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by vo...@apache.org on 2020/02/19 12:13:04 UTC

[rocketmq-client-go] branch native updated: fix(strategy): change the deafult mq sort to ASC when do rebalance. (#420)

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

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


The following commit(s) were added to refs/heads/native by this push:
     new f2db09f  fix(strategy): change the deafult mq sort to ASC when do rebalance. (#420)
f2db09f is described below

commit f2db09fe1921f78db6df31d3ed59d3c93dbcd49a
Author: dinglei <li...@163.com>
AuthorDate: Wed Feb 19 20:12:55 2020 +0800

    fix(strategy): change the deafult mq sort to ASC when do rebalance. (#420)
---
 consumer/consumer.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/consumer/consumer.go b/consumer/consumer.go
index c46917e..2a1f9af 100644
--- a/consumer/consumer.go
+++ b/consumer/consumer.go
@@ -396,12 +396,12 @@ func (dc *defaultConsumer) doBalance() {
 			sort.SliceStable(mqAll, func(i, j int) bool {
 				v := strings.Compare(mqAll[i].Topic, mqAll[j].Topic)
 				if v != 0 {
-					return v > 0
+					return v < 0
 				}
 
 				v = strings.Compare(mqAll[i].BrokerName, mqAll[j].BrokerName)
 				if v != 0 {
-					return v > 0
+					return v < 0
 				}
 				return (mqAll[i].QueueId - mqAll[j].QueueId) < 0
 			})