Commit eaf58e42 authored by Andre Freyssinet's avatar Andre Freyssinet

Disables flow control if max value is less than 0.

parent 5a01406d
......@@ -180,16 +180,25 @@ public class AcquisitionQueue extends Queue implements AcquisitionQueueMBean {
this.properties = properties;
diff_max = Long.parseLong(properties.getProperty(DestinationConstants.ACQ_QUEUE_MAX_MSG, String.valueOf(diff_max)));
diff_min = Long.parseLong(properties.getProperty(DestinationConstants.ACQ_QUEUE_MIN_MSG, String.valueOf(diff_min)));
if (diff_max < 2) diff_max = 2;
if (diff_min >= diff_max) diff_min = diff_max -2;
if (diff_min < 0) diff_min = 0;
if (diff_max <= 0) {
// Flow-control is disabled
diff_max = diff_min = 0;
} else {
diff_min = Long.parseLong(properties.getProperty(DestinationConstants.ACQ_QUEUE_MIN_MSG, String.valueOf(diff_min)));
if (diff_max < 2) diff_max = 2;
if (diff_min >= diff_max) diff_min = diff_max -2;
if (diff_min < 0) diff_min = 0;
}
pending_max = Long.parseLong(properties.getProperty(DestinationConstants.ACQ_QUEUE_MAX_PND, String.valueOf(pending_max)));
pending_min = Long.parseLong(properties.getProperty(DestinationConstants.ACQ_QUEUE_MIN_PND, String.valueOf(pending_min)));
if (pending_max < 2) pending_max = 2;
if (pending_min >= pending_max) pending_min = pending_max -2;
if (pending_min < 0) pending_min = 0;
if (pending_max <= 0) {
pending_max = pending_min = 0;
} else {
pending_min = Long.parseLong(properties.getProperty(DestinationConstants.ACQ_QUEUE_MIN_PND, String.valueOf(pending_min)));
if (pending_max < 2) pending_max = 2;
if (pending_min >= pending_max) pending_min = pending_max -2;
if (pending_min < 0) pending_min = 0;
}
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment