@Override public int compare(Subscription s1, Subscription s2) { // We want the list sorted in descending order int val = s2.getConsumerInfo().getPriority() - s1.getConsumerInfo().getPriority(); if (val == 0 && messageGroupOwners != null) { // then ascending order of assigned message groups to favour less loaded consumers // Long.compare in jdk7 long x = s1.getConsumerInfo().getAssignedGroupCount(destination); long y = s2.getConsumerInfo().getAssignedGroupCount(destination); val = (x < y) ? -1 : ((x == y) ? 0 : 1); } return val; } };
getDestinationStatistics().getDispatched().getCount(), getDestinationStatistics().getInflight().getCount(), sub.getConsumerInfo().getAssignedGroupCount(destination) }); consumersLock.writeLock().lock();
@Override public int compare(Subscription s1, Subscription s2) { // We want the list sorted in descending order int val = s2.getConsumerInfo().getPriority() - s1.getConsumerInfo().getPriority(); if (val == 0 && messageGroupOwners != null) { // then ascending order of assigned message groups to favour less loaded consumers // Long.compare in jdk7 long x = s1.getConsumerInfo().getAssignedGroupCount(destination); long y = s2.getConsumerInfo().getAssignedGroupCount(destination); val = (x < y) ? -1 : ((x == y) ? 0 : 1); } return val; } };
@Override public int compare(Subscription s1, Subscription s2) { // We want the list sorted in descending order int val = s2.getConsumerInfo().getPriority() - s1.getConsumerInfo().getPriority(); if (val == 0 && messageGroupOwners != null) { // then ascending order of assigned message groups to favour less loaded consumers // Long.compare in jdk7 long x = s1.getConsumerInfo().getAssignedGroupCount(destination); long y = s2.getConsumerInfo().getAssignedGroupCount(destination); val = (x < y) ? -1 : ((x == y) ? 0 : 1); } return val; } };
@Override public int compare(Subscription s1, Subscription s2) { // We want the list sorted in descending order int val = s2.getConsumerInfo().getPriority() - s1.getConsumerInfo().getPriority(); if (val == 0 && messageGroupOwners != null) { // then ascending order of assigned message groups to favour less loaded consumers // Long.compare in jdk7 long x = s1.getConsumerInfo().getAssignedGroupCount(destination); long y = s2.getConsumerInfo().getAssignedGroupCount(destination); val = (x < y) ? -1 : ((x == y) ? 0 : 1); } return val; } };
getDestinationStatistics().getDispatched().getCount(), getDestinationStatistics().getInflight().getCount(), sub.getConsumerInfo().getAssignedGroupCount(destination) }); consumersLock.writeLock().lock();
getDestinationStatistics().getDispatched().getCount(), getDestinationStatistics().getInflight().getCount(), sub.getConsumerInfo().getAssignedGroupCount(destination) }); consumersLock.writeLock().lock();
getDestinationStatistics().getDispatched().getCount(), getDestinationStatistics().getInflight().getCount(), sub.getConsumerInfo().getAssignedGroupCount(destination) }); consumersLock.writeLock().lock();