diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2007-03-27 16:36:34 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2007-03-27 16:36:34 +0000 |
| commit | 4c19b294416de85a744b4b0d439465e8f206a390 (patch) | |
| tree | 27b6d143b66385ce01e81444102db0c2e5ed3e8f /java/client/src | |
| parent | 4df6fb3f227c479286358f14015e1e5fd31ba644 (diff) | |
| download | qpid-python-4c19b294416de85a744b4b0d439465e8f206a390.tar.gz | |
Added additional logging and comments
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@522990 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src')
3 files changed, 14 insertions, 3 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java index 184bc44912..6ff281b14e 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java @@ -1248,8 +1248,10 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi { JMSException ex = new JMSException("Error registering consumer: " + e); - //todo remove - e.printStackTrace(); + if (_logger.isDebugEnabled()) + { + e.printStackTrace(); + } ex.setLinkedException(e); throw ex; } @@ -2089,7 +2091,7 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi // Remove the consumer from the map BasicMessageConsumer consumer = (BasicMessageConsumer) _consumers.get(consumerTag); if (consumer != null) - { + { // fixme this isn't right.. needs to check if _queue contains data for this consumer if (consumer.isAutoClose())// && _queue.isEmpty()) { diff --git a/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java b/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java index e2b101ab79..f62baf2c3a 100644 --- a/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java +++ b/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java @@ -94,6 +94,8 @@ public class ChannelCloseMethodHandler implements StateAwareMethodListener } } + //fixme why is this only done when the close is expected... + // should the above forced closes not also cause a close? protocolSession.channelClosed(evt.getChannelId(), errorCode, String.valueOf(reason)); } } diff --git a/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java b/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java index d0cc52271a..1299145ff2 100644 --- a/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java +++ b/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java @@ -34,6 +34,7 @@ import org.apache.qpid.AMQConnectionClosedException; import org.apache.qpid.AMQDisconnectedException; import org.apache.qpid.AMQException; import org.apache.qpid.AMQTimeoutException; +import org.apache.qpid.AMQChannelClosedException; import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.AMQSession; import org.apache.qpid.client.SSLConfiguration; @@ -248,6 +249,12 @@ public class AMQProtocolHandler extends IoHandlerAdapter sessionClosed(session); } + + //FIXME Need to correctly handle other exceptions. Things like ... +// if (cause instanceof AMQChannelClosedException) + // which will cause the JMSSession to end due to a channel close and so that Session needs + // to be removed from the map so we can correctly still call close without an exception when trying to close + // the server closed session. See also CloseChannelMethodHandler as the sessionClose is never called on exception } // we reach this point if failover was attempted and failed therefore we need to let the calling app // know since we cannot recover the situation |
