summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2007-10-09 18:18:51 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2007-10-09 18:18:51 +0000
commit695761a845136a558de331fb0b0a49ecb9316da3 (patch)
treec2b10adb4481010473cd1c843b30cc12f7b601cc /qpid/cpp
parentfc25fad2759f28eb8813343279517ed40aa0a8c8 (diff)
downloadqpid-python-695761a845136a558de331fb0b0a49ecb9316da3.tar.gz
Added some debug logs to indicate credit levels and verify if a message is enqueued.
I found it useful during testing git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@583253 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/broker/Queue.cpp1
-rw-r--r--qpid/cpp/src/qpid/broker/SemanticState.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp
index 95fff2e789..e190a82485 100644
--- a/qpid/cpp/src/qpid/broker/Queue.cpp
+++ b/qpid/cpp/src/qpid/broker/Queue.cpp
@@ -80,6 +80,7 @@ void Queue::deliver(Message::shared_ptr& msg){
}else {
push(msg);
}
+ QPID_LOG(debug, "Message Enqueued: " << msg->getApplicationHeaders());
serializer.execute(dispatchCallback);
}
}
diff --git a/qpid/cpp/src/qpid/broker/SemanticState.cpp b/qpid/cpp/src/qpid/broker/SemanticState.cpp
index cf16541949..ade79cb5c4 100644
--- a/qpid/cpp/src/qpid/broker/SemanticState.cpp
+++ b/qpid/cpp/src/qpid/broker/SemanticState.cpp
@@ -255,6 +255,7 @@ bool SemanticState::ConsumerImpl::deliver(QueuedMessage& msg)
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::deliver(QueuedMessage& msg)
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::setCreditMode(const std::string& destination)
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)