You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/03/05 22:47:03 UTC

svn commit: r919629 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core: ActiveMQConnectionSupport.cpp ActiveMQConnectionSupport.h ActiveMQConstants.cpp ActiveMQConstants.h

Author: tabish
Date: Fri Mar  5 21:47:03 2010
New Revision: 919629

URL: http://svn.apache.org/viewvc?rev=919629&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-287

Add useCompression to the Connection's configuration properties.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.cpp?rev=919629&r1=919628&r2=919629&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.cpp Fri Mar  5 21:47:03 2010
@@ -58,6 +58,11 @@
             core::ActiveMQConstants::toString(
                 core::ActiveMQConstants::CONNECTION_USEASYNCSEND ), "false" ) ) );
 
+    this->setUseCompression( Boolean::parseBoolean(
+        properties->getProperty(
+            core::ActiveMQConstants::toString(
+                core::ActiveMQConstants::CONNECTION_USECOMPRESSION ), "false" ) ) );
+
     this->setProducerWindowSize( decaf::lang::Integer::parseInt(
         properties->getProperty(
             core::ActiveMQConstants::toString(

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.h?rev=919629&r1=919628&r2=919629&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionSupport.h Fri Mar  5 21:47:03 2010
@@ -64,6 +64,13 @@
         bool useAsyncSend;
 
         /**
+         * Boolean indicating if messages sent from this Connection should use Message
+         * body compression.  When enabled the body of a Message is compressed before
+         * it is marshalled to the wire using a Java compatible ZLib compression format.
+         */
+        bool useCompression;
+
+        /**
          * Send Timeout, forces all messages to be sent Synchronously.
          */
         unsigned int sendTimeout;
@@ -192,6 +199,24 @@
         }
 
         /**
+         * Gets if the Connection is configured for Message body compression.
+         * @returns if the Message body will be Compressed or not.
+         */
+        bool isUseCompression() const {
+            return this->useCompression;
+        }
+
+        /**
+         * Sets whether Message body compression is enabled.
+         *
+         * @param value
+         *      Boolean indicating if Message body compression is enabled.
+         */
+        void setUseCompression( bool value ) {
+            this->useCompression = value;
+        }
+
+        /**
          * Gets the assigned send timeout for this Connector
          * @return the send timeout configured in the connection uri
          */

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.cpp?rev=919629&r1=919628&r2=919629&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.cpp Fri Mar  5 21:47:03 2010
@@ -50,6 +50,7 @@
     uriParams[CONNECTION_PRODUCERWINDOWSIZE] = "connection.producerWindowSize";
     uriParams[CONNECTION_ALWAYSSYNCSEND] = "connection.alwaysSyncSend";
     uriParams[CONNECTION_USEASYNCSEND] = "connection.useAsyncSend";
+    uriParams[CONNECTION_USECOMPRESSION] = "connection.useCompression";
     uriParams[PARAM_USERNAME] = "username";
     uriParams[PARAM_PASSWORD] = "password";
     uriParams[PARAM_CLIENTID] = "client-id";

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.h?rev=919629&r1=919628&r2=919629&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.h Fri Mar  5 21:47:03 2010
@@ -88,6 +88,7 @@
             CONNECTION_CLOSETIMEOUT,
             CONNECTION_ALWAYSSYNCSEND,
             CONNECTION_USEASYNCSEND,
+            CONNECTION_USECOMPRESSION,
             PARAM_USERNAME,
             PARAM_PASSWORD,
             PARAM_CLIENTID,