summaryrefslogtreecommitdiff
path: root/java/common
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2012-05-29 11:39:25 +0000
committerRobert Gemmell <robbie@apache.org>2012-05-29 11:39:25 +0000
commit5ff21aeaff44c5e4377c392499cd3654b3f17d2c (patch)
tree79e0626b1eec511a5cafb4b9e1c36ebd091900f6 /java/common
parent90130b03d9be32267b47a6dfc222bdbff9a8cc45 (diff)
downloadqpid-python-5ff21aeaff44c5e4377c392499cd3654b3f17d2c.tar.gz
QPID-3986, QPID-4009, QPID-4017: add constants for system properties/defaults. Update default values for flow control timeouts to be consistent between 0-8/9/9-1 and 0-10 client paths (60sec). Increase the 'failover method timeout' for 0-8/9/9-1 client path to 120sec. Update documentation accordingly.
Work by Philip Harvey <phil@philharveyonline.com> and myself, based on review feedback. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1343680 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common')
-rw-r--r--java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java24
-rw-r--r--java/common/src/main/java/org/apache/qpid/transport/Session.java14
2 files changed, 29 insertions, 9 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java b/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
index 3227bb6fc2..97fbd43ea0 100644
--- a/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
+++ b/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
@@ -168,4 +168,28 @@ public class ClientProperties
public static final String SEND_BUFFER_SIZE_PROP_NAME = "qpid.send_buffer_size";
@Deprecated
public static final String LEGACY_SEND_BUFFER_SIZE_PROP_NAME = "amqj.sendBufferSize";
+
+ /**
+ * System property to set the time (in millis) to wait before failing when sending and
+ * the client has been flow controlled by the broker.
+ */
+ public static final String QPID_FLOW_CONTROL_WAIT_FAILURE = "qpid.flow_control_wait_failure";
+
+ /**
+ * Default time (in millis) to wait before failing when sending and the client has been
+ * flow controlled by the broker.
+ */
+ public static final long DEFAULT_FLOW_CONTROL_WAIT_FAILURE = 60000L;
+
+ /**
+ * System property to set the time (in millis) between log notifications that a
+ * send is waiting because the client was flow controlled by the broker.
+ */
+ public static final String QPID_FLOW_CONTROL_WAIT_NOTIFY_PERIOD = "qpid.flow_control_wait_notify_period";
+
+ /**
+ * Default time (in millis) between log notifications that a send is
+ * waiting because the client was flow controlled by the broker.
+ */
+ public static final long DEFAULT_FLOW_CONTROL_WAIT_NOTIFY_PERIOD = 5000L;
}
diff --git a/java/common/src/main/java/org/apache/qpid/transport/Session.java b/java/common/src/main/java/org/apache/qpid/transport/Session.java
index 9a9e131adc..95c3e4669f 100644
--- a/java/common/src/main/java/org/apache/qpid/transport/Session.java
+++ b/java/common/src/main/java/org/apache/qpid/transport/Session.java
@@ -94,8 +94,10 @@ public class Session extends SessionInvoker
private final long timeout = Long.getLong(ClientProperties.QPID_SYNC_OP_TIMEOUT,
Long.getLong(ClientProperties.AMQJ_DEFAULT_SYNCWRITE_TIMEOUT,
ClientProperties.DEFAULT_SYNC_OPERATION_TIMEOUT));
- private final long blockedSendTimeout = Long.getLong("qpid.flow_control_wait_failure", timeout);
- private long blockedSendReportingPeriod = Long.getLong("qpid.flow_control_wait_notify_period",5000L);
+ private final long blockedSendTimeout = Long.getLong(ClientProperties.QPID_FLOW_CONTROL_WAIT_FAILURE,
+ ClientProperties.DEFAULT_FLOW_CONTROL_WAIT_FAILURE);
+ private long blockedSendReportingPeriod = Long.getLong(ClientProperties.QPID_FLOW_CONTROL_WAIT_NOTIFY_PERIOD,
+ ClientProperties.DEFAULT_FLOW_CONTROL_WAIT_NOTIFY_PERIOD);
private boolean autoSync = false;
@@ -215,12 +217,6 @@ public class Session extends SessionInvoker
return this.state;
}
- public boolean isFlowControlled()
- {
- return flowControl;
- }
-
-
void setFlowControl(boolean value)
{
flowControl = value;
@@ -1201,6 +1197,6 @@ public class Session extends SessionInvoker
*/
public boolean isFlowBlocked()
{
- return isFlowControlled() && credit.availablePermits() == 0;
+ return flowControl && credit.availablePermits() == 0;
}
}