diff options
author | Martin Ritchie <ritchiem@apache.org> | 2009-04-14 15:05:10 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2009-04-14 15:05:10 +0000 |
commit | 0f66d4c96c6810d01c6dc7e5c571732430c7aa0e (patch) | |
tree | 695454a1c3e0c940d8fb6de1a04e709ffedc488f /qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java | |
parent | a2c4c70d6218a9ff70372d55c8528e48f033d542 (diff) | |
download | qpid-python-0.5-fix.tar.gz |
Merged change to SlowMessageStore to ensure we don't infinitely configure the same class.0.5-fix
QPID-1621: add ServerConfiguration, QueueConfiguration and SecurityConfiguration classes. Move almost all uses of o.a.commons.configuration.Configuration behind there. @Configured delenda est
Merged changed from trunk r745799
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.5-fix@764816 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java')
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java index 76422c6297..add68c5b27 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java @@ -541,6 +541,7 @@ public abstract class BasicMessageConsumer<U> extends Closeable implements Messa if (!_closed.getAndSet(true)) { + _closing.set(true); if (_logger.isDebugEnabled()) { StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); @@ -561,7 +562,13 @@ public abstract class BasicMessageConsumer<U> extends Closeable implements Messa { try { - sendCancel(); + // If the session is open or we are in the process + // of closing the session then send a cance + // no point otherwise as the connection will be gone + if (!_session.isClosed() || _session.isClosing()) + { + sendCancel(); + } } catch (AMQException e) { |