From f928e4f407cc362b20c19eeca7385978844dc892 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Sun, 19 Feb 2012 20:32:26 +0000 Subject: QPID-3293: add new system properties for setting client send/receive buffer sizes on connections, restore legacy properties git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1291056 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/configuration/ClientProperties.java | 20 +++++++++++++++++++- .../apache/qpid/transport/ConnectionSettings.java | 21 +++++++++++++-------- 2 files changed, 32 insertions(+), 9 deletions(-) (limited to 'java/common/src/main') 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 19a77d143e..3227bb6fc2 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 @@ -134,7 +134,7 @@ public class ClientProperties /** * System property used to set the trust manager factory algorithm. * - * Historically, Qpid referred to this {@value #QPID_SSL_TRUST_STORE_CERT_TYPE_PROP_NAME}. + * Historically, Qpid referred to this as {@value #QPID_SSL_TRUST_STORE_CERT_TYPE_PROP_NAME}. */ public static final String QPID_SSL_TRUST_MANAGER_FACTORY_ALGORITHM_PROP_NAME = "qpid.ssl.TrustManagerFactory.algorithm"; @Deprecated @@ -150,4 +150,22 @@ public class ClientProperties * value is used in the ConnectionStartOk reply to the broker. */ public static final String PROCESS_NAME = "qpid.client_process"; + + /** + * System property used to set the socket receive buffer size. + * + * Historically, Qpid referred to this as {@value #LEGACY_RECEIVE_BUFFER_SIZE_PROP_NAME}. + */ + public static final String RECEIVE_BUFFER_SIZE_PROP_NAME = "qpid.receive_buffer_size"; + @Deprecated + public static final String LEGACY_RECEIVE_BUFFER_SIZE_PROP_NAME = "amqj.receiveBufferSize"; + + /** + * System property used to set the socket send buffer size. + * + * Historically, Qpid referred to this as {@value #LEGACY_SEND_BUFFER_SIZE_PROP_NAME}. + */ + 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"; } diff --git a/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java b/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java index d0eb44fffc..084428d182 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java +++ b/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java @@ -20,6 +20,17 @@ */ package org.apache.qpid.transport; +import static org.apache.qpid.configuration.ClientProperties.AMQJ_TCP_NODELAY_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.QPID_SSL_KEY_MANAGER_FACTORY_ALGORITHM_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.QPID_SSL_KEY_STORE_CERT_TYPE_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.QPID_SSL_TRUST_MANAGER_FACTORY_ALGORITHM_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.QPID_SSL_TRUST_STORE_CERT_TYPE_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.QPID_TCP_NODELAY_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.RECEIVE_BUFFER_SIZE_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.SEND_BUFFER_SIZE_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.LEGACY_RECEIVE_BUFFER_SIZE_PROP_NAME; +import static org.apache.qpid.configuration.ClientProperties.LEGACY_SEND_BUFFER_SIZE_PROP_NAME; + import java.util.Map; import javax.net.ssl.KeyManagerFactory; @@ -27,12 +38,6 @@ import javax.net.ssl.TrustManagerFactory; import org.apache.qpid.configuration.QpidProperty; -import static org.apache.qpid.configuration.ClientProperties.QPID_TCP_NODELAY_PROP_NAME; -import static org.apache.qpid.configuration.ClientProperties.AMQJ_TCP_NODELAY_PROP_NAME; -import static org.apache.qpid.configuration.ClientProperties.QPID_SSL_KEY_MANAGER_FACTORY_ALGORITHM_PROP_NAME; -import static org.apache.qpid.configuration.ClientProperties.QPID_SSL_KEY_STORE_CERT_TYPE_PROP_NAME; -import static org.apache.qpid.configuration.ClientProperties.QPID_SSL_TRUST_MANAGER_FACTORY_ALGORITHM_PROP_NAME; -import static org.apache.qpid.configuration.ClientProperties.QPID_SSL_TRUST_STORE_CERT_TYPE_PROP_NAME; /** * A ConnectionSettings object can only be associated with @@ -54,8 +59,8 @@ public class ConnectionSettings private int maxChannelCount = 32767; private int maxFrameSize = 65535; private int heartbeatInterval; - private int readBufferSize = 65535; - private int writeBufferSize = 65535; + private int readBufferSize = QpidProperty.intProperty(65535, RECEIVE_BUFFER_SIZE_PROP_NAME, LEGACY_RECEIVE_BUFFER_SIZE_PROP_NAME).get(); + private int writeBufferSize = QpidProperty.intProperty(65535, SEND_BUFFER_SIZE_PROP_NAME, LEGACY_SEND_BUFFER_SIZE_PROP_NAME).get();; private long transportTimeout = 60000; // SSL props -- cgit v1.2.1