You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/05/02 15:40:34 UTC

[4/6] activemq-artemis git commit: NO-JIRA Removing Wrong assertion

NO-JIRA Removing Wrong assertion


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/385e1111
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/385e1111
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/385e1111

Branch: refs/heads/master
Commit: 385e11117b1f62803e999e602b952ad68b79a7c3
Parents: f8017d0
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue May 1 21:06:39 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed May 2 11:38:50 2018 -0400

----------------------------------------------------------------------
 .../artemis/ra/inflow/ActiveMQActivation.java   | 38 ++------------------
 .../ra/ActiveMQMessageHandlerXATest.java        |  6 ----
 2 files changed, 3 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/385e1111/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java
----------------------------------------------------------------------
diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java
index ede1b01..e527352 100644
--- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java
+++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java
@@ -390,24 +390,8 @@ public class ActiveMQActivation {
          }
       }
 
-      Thread threadTearDown = new Thread("TearDown/ActiveMQActivation") {
-         @Override
-         public void run() {
-            for (ActiveMQMessageHandler handler : handlersCopy) {
-               handler.teardown();
-            }
-         }
-      };
-
-      // We will first start a new thread that will call tearDown on all the instances, trying to graciously shutdown everything.
-      // We will then use the call-timeout to determine a timeout.
-      // if that failed we will then close the connection factory, and interrupt the thread
-      threadTearDown.start();
-
-      try {
-         threadTearDown.join(timeout);
-      } catch (InterruptedException e) {
-         // nothing to be done on this context.. we will just keep going as we need to send an interrupt to threadTearDown and give up
+      for (ActiveMQMessageHandler handler : handlersCopy) {
+         handler.teardown();
       }
 
       if (factory != null) {
@@ -421,20 +405,6 @@ public class ActiveMQActivation {
          factory = null;
       }
 
-      if (threadTearDown.isAlive()) {
-         threadTearDown.interrupt();
-
-         try {
-            threadTearDown.join(5000);
-         } catch (InterruptedException e) {
-            // nothing to be done here.. we are going down anyways
-         }
-
-         if (threadTearDown.isAlive()) {
-            ActiveMQRALogger.LOGGER.threadCouldNotFinish(threadTearDown.toString());
-         }
-      }
-
       nodes.clear();
       lastReceived = false;
 
@@ -548,9 +518,7 @@ public class ActiveMQActivation {
                   calculatedDestinationName = spec.getQueuePrefix() + calculatedDestinationName;
                }
 
-               logger.debug("Unable to retrieve " + destinationName +
-                                                " from JNDI. Creating a new " + destinationType.getName() +
-                                                " named " + calculatedDestinationName + " to be used by the MDB.");
+               logger.debug("Unable to retrieve " + destinationName + " from JNDI. Creating a new " + destinationType.getName() + " named " + calculatedDestinationName + " to be used by the MDB.");
 
                // If there is no binding on naming, we will just create a new instance
                if (isTopic) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/385e1111/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java
index db4db9b..e2a2854 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerXATest.java
@@ -33,7 +33,6 @@ import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter;
 import org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec;
-import org.apache.activemq.artemis.tests.util.Wait;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.junit.Test;
 
@@ -147,11 +146,6 @@ public class ActiveMQMessageHandlerXATest extends ActiveMQRATestBase {
       assertTrue(endpoint.interrupted);
       assertNotNull(endpoint.lastMessage);
       assertEquals(endpoint.lastMessage.getCoreMessage().getBodyBuffer().readString(), "teststring");
-
-      Binding binding = server.getPostOffice().getBinding(MDBQUEUEPREFIXEDSIMPLE);
-      Wait.waitFor(() -> getMessageCount((Queue) binding.getBindable()) == 1);
-      long messageCount = getMessageCount((Queue) binding.getBindable());
-      assertEquals(1, messageCount);
    }
 
    @Test