Author: rajith
Date: Tue Oct 9 11:18:51 2007
New Revision: 583253
URL: http://svn.apache.org/viewvc?rev=583253&view=rev
Log:
Added some debug logs to indicate credit levels and verify if a message is
enqueued.
I found it useful during testing
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
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=583253&r1=583252&r2=583253&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Tue Oct 9 11:18:51
2007
@@ -80,6 +80,7 @@
}else {
push(msg);
}
+ QPID_LOG(debug, "Message Enqueued: " << msg->getApplicationHeaders());
serializer.execute(dispatchCallback);
}
}
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=583253&r1=583252&r2=583253&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Tue Oct 9
11:18:51 2007
@@ -255,6 +255,7 @@
DeliveryId deliveryTag =
parent->deliveryAdapter.deliver(msg.payload, token);
+ QPID_LOG(debug, "Message delivered for destination " << name);
if (windowing || ackExpected) {
parent->record(DeliveryRecord(msg, queue, name, token,
deliveryTag, acquire, !ackExpected));
}
@@ -265,9 +266,11 @@
bool SemanticState::ConsumerImpl::checkCredit(Message::shared_ptr& msg)
{
+ QPID_LOG(debug, "Credit check for destination " << name << " byteCredit: "
<< byteCredit << " msgCredit: " << msgCredit);
Mutex::ScopedLock l(lock);
if (msgCredit == 0 || (byteCredit != 0xFFFFFFFF && byteCredit <
msg->getRequiredCredit())) {
return false;
+ QPID_LOG(debug, "Credit is empty for destination " << name);
} else {
if (msgCredit != 0xFFFFFFFF) {
msgCredit--;
@@ -475,12 +478,14 @@
void SemanticState::addByteCredit(const std::string& destination, uint32_t
value)
{
find(destination).addByteCredit(value);
+ QPID_LOG(debug, "Byte Credits Requested for " << destination << ": " <<
value);
}
void SemanticState::addMessageCredit(const std::string& destination, uint32_t
value)
{
find(destination).addMessageCredit(value);
+ QPID_LOG(debug, "Message Credit Requested for " << destination << ": " <<
value);
}
void SemanticState::flush(const std::string& destination)