QPID-8212: Improve handling of received method frames
authorAlex Rudyy <orudyy@apache.org>
Mon, 9 Jul 2018 22:55:14 +0000 (23:55 +0100)
committerAlex Rudyy <orudyy@apache.org>
Mon, 9 Jul 2018 22:55:14 +0000 (23:55 +0100)
client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java

index 3986bb3..13c122f 100644 (file)
@@ -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);
         }
     }