summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-02-07 15:43:33 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-02-07 15:43:33 +0000
commit3b6459da09f50e039ba79fabd5da19c3b2cab1f5 (patch)
treebcc3ed9f7ffd2c790a44d210a186636aff19e365
parentc644c15854ff72bf1770bb46a5aee10dc4b83ebb (diff)
downloadqpid-python-3b6459da09f50e039ba79fabd5da19c3b2cab1f5.tar.gz
Added guards to debug and trace statements noted during debuging.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/perftesting@504596 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java24
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java16
-rw-r--r--qpid/java/distribution/pom.xml2
3 files changed, 35 insertions, 7 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
index 8e9382a9be..755f2f271b 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
@@ -228,7 +228,10 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
int errorCode = message.bounceBody.replyCode;
String reason = message.bounceBody.replyText;
- _logger.debug("Message returned with error code " + errorCode + " (" + reason + ")");
+ if (_logger.isDebugEnabled())
+ {
+ _logger.debug("Message returned with error code " + errorCode + " (" + reason + ")");
+ }
//@TODO should this be moved to an exception handler of sorts. Somewhere errors are converted to correct execeptions.
if (errorCode == AMQConstant.NO_CONSUMERS.getCode())
@@ -275,6 +278,8 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
_queue.clear();
+ _logger.trace("Queue cleared");
+
for (BasicMessageConsumer consumer : _consumers.values())
{
consumer.rollback();
@@ -325,7 +330,10 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
{
if (_acknowledgeMode == NO_ACKNOWLEDGE)
{
- _logger.warn("Above threshold(" + _defaultPrefetchHighMark + ") so suspending channel. Current value is " + currentValue);
+ if (_logger.isDebugEnabled())
+ {
+ _logger.debug("Above threshold(" + _defaultPrefetchHighMark + ") so suspending channel. Current value is " + currentValue);
+ }
new Thread(new SuspenderRunner(true)).start();
}
@@ -335,7 +343,10 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
{
if (_acknowledgeMode == NO_ACKNOWLEDGE)
{
- _logger.warn("Below threshold(" + _defaultPrefetchLowMark + ") so unsuspending channel. Current value is " + currentValue);
+ if (_logger.isDebugEnabled())
+ {
+ _logger.debug("Below threshold(" + _defaultPrefetchLowMark + ") so unsuspending channel. Current value is " + currentValue);
+ }
new Thread(new SuspenderRunner(false)).start();
}
@@ -1815,10 +1826,13 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
{
synchronized (_suspensionLock)
{
- _logger.warn("Setting channel flow : " + (suspend ? "suspended" : "unsuspended"));
+ if (_logger.isDebugEnabled())
+ {
+ _logger.debug("Setting channel flow : " + (suspend ? "suspended" : "unsuspended"));
+ }
_suspended = suspend;
-
+
// AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
// TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
// Be aware of possible changes to parameter order as versions change.
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java b/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java
index b7b47048c5..4087db6562 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java
@@ -20,7 +20,7 @@
*/
package org.apache.qpid.client.util;
-import org.apache.qpid.AMQException;
+import org.apache.log4j.Logger;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
@@ -33,6 +33,8 @@ import java.util.concurrent.LinkedBlockingQueue;
*/
public class FlowControllingBlockingQueue
{
+ private static final Logger _logger = Logger.getLogger(FlowControllingBlockingQueue.class);
+
/** This queue is bounded and is used to store messages before being dispatched to the consumer */
private final BlockingQueue _queue = new LinkedBlockingQueue();
@@ -71,6 +73,12 @@ public class FlowControllingBlockingQueue
public Object take() throws InterruptedException
{
Object o = _queue.take();
+
+ if (_logger.isTraceEnabled())
+ {
+ _logger.trace("Object taken from queue:" + o);
+ }
+
if (_listener != null)
{
synchronized (_listener)
@@ -87,6 +95,12 @@ public class FlowControllingBlockingQueue
public void add(Object o)
{
_queue.add(o);
+
+ if (_logger.isTraceEnabled())
+ {
+ _logger.trace("Object added to queue:" + o);
+ }
+
if (_listener != null)
{
synchronized (_listener)
diff --git a/qpid/java/distribution/pom.xml b/qpid/java/distribution/pom.xml
index 328a11d210..a64189ba2f 100644
--- a/qpid/java/distribution/pom.xml
+++ b/qpid/java/distribution/pom.xml
@@ -38,7 +38,7 @@
<java.source.version>1.5</java.source.version>
<qpid.version>${pom.version}</qpid.version>
<qpid.targetDir>${project.build.directory}</qpid.targetDir>
- <release.revision>-r504143</release.revision>
+ <release.revision>-r504596</release.revision>
</properties>
<repositories>