activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1337352 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp
Date Fri, 11 May 2012 20:04:43 GMT
Author: tabish
Date: Fri May 11 20:04:42 2012
New Revision: 1337352

URL: http://svn.apache.org/viewvc?rev=1337352&view=rev
Log:
Remove code duplication and fix setting of the message ack handler callback.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp?rev=1337352&r1=1337351&r2=1337352&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp
Fri May 11 20:04:42 2012
@@ -217,7 +217,6 @@ namespace kernels {
         }
 
         void acknowledgeMessage(const commands::Message* message AMQCPP_UNUSED ) {
-
             try {
                 this->session->acknowledge();
             }
@@ -250,10 +249,8 @@ namespace kernels {
             }
         }
 
-        void acknowledgeMessage(const commands::Message* message AMQCPP_UNUSED ) {
-
+        void acknowledgeMessage(const commands::Message* message AMQCPP_UNUSED) {
             try {
-
                 if (this->dispatch != NULL) {
                     this->consumer->acknowledge(this->dispatch);
                     this->dispatch.reset(NULL);
@@ -1205,16 +1202,7 @@ bool ActiveMQConsumerKernel::iterate() {
         if (this->internal->listener != NULL) {
             Pointer<MessageDispatch> dispatch = internal->unconsumedMessages->dequeueNoWait();
             if (dispatch != NULL) {
-
-                try {
-                    beforeMessageIsConsumed(dispatch);
-                    this->internal->listener->onMessage(
-                        dynamic_cast<cms::Message*> (dispatch->getMessage().get()));
-                    afterMessageIsConsumed(dispatch, false);
-                } catch (ActiveMQException& ex) {
-                    this->session->fire(ex);
-                }
-
+                this->dispatch(dispatch);
                 return true;
             }
         }



Mime
View raw message