activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [activemq-artemis] branch master updated: ARTEMIS-2333 NettyConnection is not writeable if disconnected
Date Wed, 08 May 2019 19:34:47 GMT
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 7e8829b  ARTEMIS-2333 NettyConnection is not writeable if disconnected
     new d0a1cb3  This closes #2663
7e8829b is described below

commit 7e8829bee42911b134315f036193072f985dd9a6
Author: Clebert Suconic <clebertsuconic@apache.org>
AuthorDate: Wed May 8 14:33:06 2019 -0400

    ARTEMIS-2333 NettyConnection is not writeable if disconnected
    
    This is fixing StompV12Test
---
 .../core/remoting/impl/netty/NettyConnection.java  |  2 +-
 .../tests/integration/stomp/v12/StompV12Test.java  | 34 +++++++++++-----------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
index f3e5678..8029931 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
@@ -137,7 +137,7 @@ public class NettyConnection implements Connection {
             readyListeners.add(callback);
          }
 
-         return ready;
+         return ready && channel.isOpen();
       }
    }
 
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
index 3e6e46c..2384de9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
@@ -884,7 +884,7 @@ public class StompV12Test extends StompTestBase {
 
       //Nack makes the message be dropped.
       MessageConsumer consumer = session.createConsumer(queue);
-      Message message = consumer.receive(1000);
+      Message message = consumer.receiveNoWait();
       Assert.assertNull(message);
    }
 
@@ -966,7 +966,7 @@ public class StompV12Test extends StompTestBase {
 
       //Nack makes the message be dropped.
       MessageConsumer consumer = session.createConsumer(queue);
-      Message message = consumer.receive(1000);
+      Message message = consumer.receiveNoWait();
       Assert.assertNull(message);
    }
 
@@ -1134,7 +1134,7 @@ public class StompV12Test extends StompTestBase {
 
       //no messages can be received.
       MessageConsumer consumer = session.createConsumer(queue);
-      Message message = consumer.receive(1000);
+      Message message = consumer.receiveNoWait();
       Assert.assertNull(message);
    }
 
@@ -1170,7 +1170,7 @@ public class StompV12Test extends StompTestBase {
       MessageConsumer consumer = session.createConsumer(queue);
       Message message = consumer.receive(1000);
       Assert.assertNotNull(message);
-      message = consumer.receive(1000);
+      message = consumer.receiveNoWait();
       Assert.assertNull(message);
    }
 
@@ -1200,7 +1200,7 @@ public class StompV12Test extends StompTestBase {
 
       //no messages can be received.
       MessageConsumer consumer = session.createConsumer(queue);
-      Message message = consumer.receive(1000);
+      Message message = consumer.receiveNoWait();
       Assert.assertNull(message);
    }
 
@@ -1229,7 +1229,7 @@ public class StompV12Test extends StompTestBase {
 
       //no messages can be received.
       MessageConsumer consumer = session.createConsumer(queue);
-      Message message = consumer.receive(1000);
+      Message message = consumer.receiveNoWait();
       Assert.assertNull(message);
    }
 
@@ -1272,7 +1272,7 @@ public class StompV12Test extends StompTestBase {
          System.out.println("Legal: " + message.getText());
       }
 
-      message = (TextMessage) consumer.receive(1000);
+      message = (TextMessage) consumer.receiveNoWait();
 
       Assert.assertNull(message);
    }
@@ -1388,7 +1388,7 @@ public class StompV12Test extends StompTestBase {
 
       abortTransaction(conn, "tx1");
 
-      frame = conn.receiveFrame(500);
+      frame = conn.receiveFrame(100);
 
       Assert.assertNull(frame);
 
@@ -1816,7 +1816,7 @@ public class StompV12Test extends StompTestBase {
       long tmsg = message.getJMSTimestamp();
       Assert.assertTrue(Math.abs(tnow - tmsg) < 1000);
 
-      Assert.assertNull(consumer.receive(1000));
+      Assert.assertNull(consumer.receiveNoWait());
 
       conn.disconnect();
    }
@@ -1933,7 +1933,7 @@ public class StompV12Test extends StompTestBase {
 
       sendJmsMessage(getName(), topic);
 
-      frame = conn.receiveFrame(1000);
+      frame = conn.receiveFrame(100);
       Assert.assertNull(frame);
 
       conn.disconnect();
@@ -1984,7 +1984,7 @@ public class StompV12Test extends StompTestBase {
 
       // message should not be received as it was auto-acked
       MessageConsumer consumer = session.createConsumer(queue);
-      Message message = consumer.receive(1000);
+      Message message = consumer.receiveNoWait();
       Assert.assertNull(message);
    }
 
@@ -2028,7 +2028,7 @@ public class StompV12Test extends StompTestBase {
 
       // message should not be received since message was acknowledged by the client
       MessageConsumer consumer = session.createConsumer(queue);
-      Message message = consumer.receive(1000);
+      Message message = consumer.receiveNoWait();
       Assert.assertNull(message);
    }
 
@@ -2150,7 +2150,7 @@ public class StompV12Test extends StompTestBase {
       Assert.assertEquals("123", frame.getHeader("receipt-id"));
 
       // check the message is not committed
-      Assert.assertNull(consumer.receive(100));
+      Assert.assertNull(consumer.receiveNoWait());
 
       commitTransaction(conn, "tx1", true);
 
@@ -2217,7 +2217,7 @@ public class StompV12Test extends StompTestBase {
       // send a message to our queue
       sendJmsMessage("second message");
 
-      frame = conn.receiveFrame(1000);
+      frame = conn.receiveFrame(100);
       Assert.assertNull(frame);
 
       conn.disconnect();
@@ -2247,7 +2247,7 @@ public class StompV12Test extends StompTestBase {
       conn = (StompClientConnectionV12) StompClientConnectionFactory.createClientConnection(uri);
       conn.connect(defUser, defPass);
 
-      frame = conn.receiveFrame(1000);
+      frame = conn.receiveFrame(100);
       Assert.assertNull("not expected: " + frame, frame);
 
       //subscribe again.
@@ -2259,12 +2259,12 @@ public class StompV12Test extends StompTestBase {
       Assert.assertNotNull(frame);
       Assert.assertTrue(frame.getCommand().equals(Stomp.Responses.MESSAGE));
 
-      frame = conn.receiveFrame(1000);
+      frame = conn.receiveFrame(100);
       Assert.assertNull("not expected: " + frame, frame);
 
       unsubscribe(conn, "sub1", true);
 
-      frame = conn.receiveFrame(1000);
+      frame = conn.receiveFrame(100);
       Assert.assertNull(frame);
 
       conn.disconnect();


Mime
View raw message