From 1167f093eaf4f03e2b7422388d6a70deb53f9e61 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Tue, 9 Oct 2007 18:18:51 +0000 Subject: 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/qpid@583253 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Queue.cpp | 1 + cpp/src/qpid/broker/SemanticState.cpp | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index 95fff2e789..e190a82485 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/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/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index cf16541949..ade79cb5c4 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/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) -- cgit v1.2.1