This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git
The following commit(s) were added to refs/heads/master by this push:
new 5f51b9c [AMQ-7407] Fix best target election for queue/topic
partitioning
new 702fb86 Merge pull request #482 from jbonofre/AMQ-7407
5f51b9c is described below
commit 5f51b9c084e38f8f10418398dbfe415d4570e325
Author: jbonofre <[email protected]>
AuthorDate: Thu Feb 27 21:39:11 2020 +0100
[AMQ-7407] Fix best target election for queue/topic partitioning
---
.../main/java/org/apache/activemq/partition/PartitionBroker.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/activemq-partition/src/main/java/org/apache/activemq/partition/PartitionBroker.java
b/activemq-partition/src/main/java/org/apache/activemq/partition/PartitionBroker.java
index 7c6d169..9362e64 100644
---
a/activemq-partition/src/main/java/org/apache/activemq/partition/PartitionBroker.java
+++
b/activemq-partition/src/main/java/org/apache/activemq/partition/PartitionBroker.java
@@ -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;