Author: gsim
Date: Thu Nov 8 07:55:41 2007
New Revision: 593212
URL: http://svn.apache.org/viewvc?rev=593212&view=rev
Log:
Exception handling for dispatch functor
Don't dequeue no-ack messages unless they have been acquired
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=593212&r1=593211&r2=593212&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Thu Nov 8 07:55:41
2007
@@ -556,3 +556,18 @@
{
return exclusive;
}
+
+void Queue::DispatchFunctor::operator()()
+{
+ try {
+ if (consumer && !consumer->preAcquires()) {
+ queue.serviceBrowser(consumer);
+ }else{
+ queue.dispatch();
+ }
+ } catch (const std::exception& e) {
+ QPID_LOG(error, "Exception on dispatch: " << e.what());
+ }
+
+ if (sync) sync->completed();
+}
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h?rev=593212&r1=593211&r2=593212&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Thu Nov 8 07:55:41
2007
@@ -71,15 +71,7 @@
DispatchFunctor(Queue& q, DispatchCompletion* s = 0) :
queue(q), sync(s) {}
DispatchFunctor(Queue& q, Consumer::ptr c, DispatchCompletion*
s = 0) : queue(q), consumer(c), sync(s) {}
- void operator()()
- {
- if (consumer && !consumer->preAcquires()) {
- queue.serviceBrowser(consumer);
- }else{
- queue.dispatch();
- }
- if (sync) sync->completed();
- }
+ void operator()();
};
const string name;
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=593212&r1=593211&r2=593212&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Thu Nov 8
07:55:41 2007
@@ -280,7 +280,7 @@
parent->deliveryAdapter.deliver(msg.payload, token);
if (windowing || ackExpected) {
parent->record(DeliveryRecord(msg, queue, name, token,
deliveryTag, acquire, !ackExpected));
- } else if (!ackExpected) {
+ } else if (acquire && !ackExpected) {
queue->dequeue(0, msg.payload);
}
}