mirror of https://github.com/apache/activemq.git
[AMQ-7407] Fix best target election for queue/topic partitioning
This commit is contained in:
parent
6e650841fd
commit
5f51b9c084
|
@ -248,12 +248,13 @@ public class PartitionBroker extends BrokerFilter {
|
|||
}
|
||||
|
||||
// The target with largest score wins..
|
||||
if( !targetScores.isEmpty() ) {
|
||||
if (!targetScores.isEmpty()) {
|
||||
Target bestTarget = null;
|
||||
int bestScore=0;
|
||||
int bestScore = 0;
|
||||
for (Map.Entry<Target, Score> entry : targetScores.entrySet()) {
|
||||
if( entry.getValue().value > bestScore ) {
|
||||
if (entry.getValue().value > bestScore) {
|
||||
bestTarget = entry.getKey();
|
||||
bestScore = entry.getValue().value;
|
||||
}
|
||||
}
|
||||
return bestTarget;
|
||||
|
|
Loading…
Reference in New Issue