You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2018/07/13 10:15:52 UTC
[1/2] qpid-jms-amqp-0-x git commit: QPID-8212: Improve handling of
received method frames
Repository: qpid-jms-amqp-0-x
Updated Branches:
refs/heads/6.3.x 242099b05 -> ea1292afb
QPID-8212: Improve handling of received method frames
(cherry picked from commit 9fe911a9576ac69b64b1d4322ceae8cd1f3cfbec)
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/commit/0a9aaa67
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/tree/0a9aaa67
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/diff/0a9aaa67
Branch: refs/heads/6.3.x
Commit: 0a9aaa675c2365530aab0475e32b70a2bdae251d
Parents: 242099b
Author: Alex Rudyy <or...@apache.org>
Authored: Mon Jul 9 23:55:14 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Fri Jul 13 11:15:21 2018 +0100
----------------------------------------------------------------------
.../org/apache/qpid/client/protocol/AMQProtocolSession.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/blob/0a9aaa67/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java b/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
index 3986bb3..13c122f 100644
--- a/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
+++ b/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
@@ -482,15 +482,13 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
@Override
public void methodFrameReceived(final int channel, final AMQMethodBody amqMethodBody) throws QpidException
{
- if ( channel == 0
- || !isClosedForInput(channel)
- || (isClosing(channel) && (amqMethodBody instanceof ChannelCloseBody || amqMethodBody instanceof ChannelCloseOkBody)))
+ try
{
_protocolHandler.methodBodyReceived(channel, amqMethodBody);
}
- else
+ catch (IllegalStateException e)
{
- _logger.debug("Ignoring method {} as channel {} closed on {}", amqMethodBody, channel);
+ throw new QpidException("Unexpected exception on receiving method " + amqMethodBody, e);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/2] qpid-jms-amqp-0-x git commit: QPID-8212: Throw exception only
when session is not closing
Posted by or...@apache.org.
QPID-8212: Throw exception only when session is not closing
(cherry picked from commit a48e285e3e6057cf4114ec057bffa685e3f51531)
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/commit/ea1292af
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/tree/ea1292af
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/diff/ea1292af
Branch: refs/heads/6.3.x
Commit: ea1292afb3638ae737f7f502ece3677356a5332f
Parents: 0a9aaa6
Author: Alex Rudyy <or...@apache.org>
Authored: Wed Jul 11 23:10:51 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Fri Jul 13 11:15:31 2018 +0100
----------------------------------------------------------------------
.../client/protocol/AMQProtocolSession.java | 36 ++++++++++++++++++--
1 file changed, 33 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/blob/ea1292af/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java b/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
index 13c122f..bce7845 100644
--- a/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
+++ b/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
@@ -480,15 +480,45 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
}
@Override
- public void methodFrameReceived(final int channel, final AMQMethodBody amqMethodBody) throws QpidException
+ public void methodFrameReceived(final int channelId, final AMQMethodBody amqMethodBody) throws QpidException
{
try
{
- _protocolHandler.methodBodyReceived(channel, amqMethodBody);
+ _protocolHandler.methodBodyReceived(channelId, amqMethodBody);
}
catch (IllegalStateException e)
{
- throw new QpidException("Unexpected exception on receiving method " + amqMethodBody, e);
+ AMQSession session = _connection.getSession(channelId);
+ if (session == null)
+ {
+ if (isClosing(channelId))
+ {
+ _logger.debug(
+ "Ignoring incoming method {} of class {} on closing channel {}",
+ amqMethodBody.getMethod(),
+ amqMethodBody.getClazz(),
+ channelId, e);
+ _protocolHandler.propagateExceptionToMethodFrameListener(channelId,
+ amqMethodBody,
+ new QpidException("Session is closing", e));
+ }
+ else
+ {
+ throw new QpidException(String.format(
+ "Method '%d' of class '%d' is received on unknown channel '%d'",
+ amqMethodBody.getMethod(),
+ amqMethodBody.getClazz(),
+ channelId));
+ }
+ }
+ else
+ {
+ throw new QpidException(String.format(
+ "Unexpected exception on receiving method '%d' of class '%d' on channel '%d'",
+ amqMethodBody.getMethod(),
+ amqMethodBody.getClazz(),
+ channelId), e);
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org