activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r688328 - in /activemq/activemq-cpp/trunk/src/main/activemq: connector/openwire/OpenWireConnector.cpp connector/openwire/OpenWireProducerInfo.h core/ActiveMQSession.cpp
Date Sat, 23 Aug 2008 14:14:20 GMT
Author: tabish
Date: Sat Aug 23 07:14:19 2008
New Revision: 688328

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

Adding some bits and pieces for the ProducerWindow size attribute in Openwire 3.0

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp?rev=688328&r1=688327&r2=688328&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
Sat Aug 23 07:14:19 2008
@@ -50,6 +50,7 @@
 #include <activemq/connector/openwire/commands/MessagePull.h>
 #include <activemq/connector/openwire/commands/MessageAck.h>
 #include <activemq/connector/openwire/commands/MessageDispatch.h>
+#include <activemq/connector/openwire/commands/ProducerAck.h>
 #include <activemq/connector/openwire/commands/RemoveInfo.h>
 #include <activemq/connector/openwire/commands/ShutdownInfo.h>
 #include <activemq/connector/openwire/commands/SessionInfo.h>
@@ -662,7 +663,7 @@
 
         commands::ProducerId* producerId = new commands::ProducerId();
         producerInfo->setProducerId( producerId );
-        producerInfo->setWindowSize( this->getProducerWindowSize( ));
+        producerInfo->setWindowSize( this->getProducerWindowSize() );
 
         producerId->setConnectionId( session->getConnectionId() );
         producerId->setSessionId( session->getSessionId() );
@@ -1358,6 +1359,13 @@
 
             delete command;
 
+        } else if( typeid( *command ) == typeid( commands::ProducerAck ) ) {
+            commands::ProducerAck* producerAck =
+                dynamic_cast<commands::ProducerAck*>( command );
+
+            // TODO - Apply The Ack.
+            delete command;
+
         } else if( typeid( *command ) == typeid( commands::WireFormatInfo ) ) {
             this->brokerWireFormatInfo =
                 dynamic_cast<commands::WireFormatInfo*>( command );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireProducerInfo.h?rev=688328&r1=688327&r2=688328&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
Sat Aug 23 07:14:19 2008
@@ -42,6 +42,10 @@
         // Send timeout, how long to wait for a response before failing.
         unsigned int sendTimeout;
 
+        // Producer Window, number of messages to send before waiting for
+        // the broker to send ProducerAcks.  Openwire 3.0 only.
+        unsigned long long producerWindow;
+
     public:
 
         OpenWireProducerInfo( Connector* connector ) :
@@ -51,6 +55,7 @@
             this->producerInfo = NULL;
             this->session = NULL;
             this->sendTimeout = 0;
+            this->producerWindow = 0;
         }
 
         virtual ~OpenWireProducerInfo() {
@@ -181,6 +186,24 @@
             this->sendTimeout = timeout;
         }
 
+        /**
+         * Gets the currently Set Producer Window
+         * @return the set producer window.
+         */
+        virtual unsigned long long getProducerWindow() const {
+            return this->producerWindow;
+        }
+
+        /**
+         * Sets the Producer Window, which is the max number of messages to send before
+         * timing waiting for acks from the broker. (Openwire 3.0 only).
+         * @param windowSize - The number of message to send before a block to wait for
+         * the receipt of a ProducerAck.
+         */
+        virtual void setProducerWindow( unsigned long long timeout ) {
+            this->sendTimeout = timeout;
+        }
+
     };
 
 }}}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp?rev=688328&r1=688327&r2=688328&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp Sat Aug 23 07:14:19
2008
@@ -633,7 +633,7 @@
                 "ActiveMQSession::acknowledgeMessage - Session Already Closed" );
         }
 
-        // Stores the Message and its consumer in the tranasction, if the
+        // Stores the Message and its consumer in the transaction, if the
         // session is a transactional one.
         if( isTransacted() ) {
             transaction->addToTransaction( message, consumer );



Mime
View raw message