You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2017/07/11 20:19:57 UTC

[1/2] activemq git commit: NO-JIRA update the AMQP tests to use the client close timeout

Repository: activemq
Updated Branches:
  refs/heads/activemq-5.14.x 6613b8f1f -> 42e4a6cd9


NO-JIRA update the AMQP tests to use the client close timeout

Use the client built in close timeout instead of the executor which can
leave threads running and causes the tests to take much longer than
needed.
(cherry picked from commit ce551cf97d95fbed89ebecf10c40a5060d7b756a)


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

Branch: refs/heads/activemq-5.14.x
Commit: 3b5a4d7078a2bde766dfeacb832a97d2ca00d83e
Parents: 6613b8f
Author: Timothy Bish <ta...@gmail.com>
Authored: Thu Jun 15 17:13:32 2017 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Thu Jun 15 17:14:09 2017 -0400

----------------------------------------------------------------------
 .../transport/amqp/AmqpTestSupport.java         |  4 ---
 .../transport/amqp/JMSClientContext.java        |  1 +
 .../transport/amqp/JMSClientTestSupport.java    | 33 ++------------------
 3 files changed, 4 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/3b5a4d70/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java
index 86402dc..69d1998 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java
@@ -25,8 +25,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 import java.util.Vector;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -69,8 +67,6 @@ public class AmqpTestSupport {
 
     protected static final Logger LOG = LoggerFactory.getLogger(AmqpTestSupport.class);
 
-    protected ExecutorService testService = Executors.newSingleThreadExecutor();
-
     protected BrokerService brokerService;
     protected Vector<Throwable> exceptions = new Vector<>();
     protected int numberOfMessages;

http://git-wip-us.apache.org/repos/asf/activemq/blob/3b5a4d70/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientContext.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientContext.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientContext.java
index f249e7c..1789792 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientContext.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientContext.java
@@ -215,6 +215,7 @@ public class JMSClientContext {
         factory.setForceSyncSend(syncPublish);
         factory.setTopicPrefix("topic://");
         factory.setQueuePrefix("queue://");
+        factory.setCloseTimeout(60000);
 
         return factory;
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/3b5a4d70/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java
index 8408652..a5c1ae5 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java
@@ -18,11 +18,6 @@ package org.apache.activemq.transport.amqp;
 
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.concurrent.Callable;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 
 import javax.jms.Connection;
 import javax.jms.JMSException;
@@ -33,40 +28,18 @@ public class JMSClientTestSupport extends AmqpTestSupport {
 
     protected Connection connection;
 
-    private Thread connectionCloseThread;
-
     @Override
     @After
     public void tearDown() throws Exception {
-        Future<Boolean> future = testService.submit(new CloseConnectionTask());
         try {
             LOG.debug("tearDown started.");
-            future.get(60, TimeUnit.SECONDS);
-        } catch (TimeoutException e) {
-            if (connectionCloseThread != null) {
-                connectionCloseThread.interrupt();;
-            }
-
-            testService.shutdownNow();
-            testService = Executors.newSingleThreadExecutor();
-            throw new Exception("CloseConnection timed out");
-        } finally {
-            connectionCloseThread = null;
-            connection = null;
-            super.tearDown();
-        }
-    }
-
-    public class CloseConnectionTask implements Callable<Boolean> {
-        @Override
-        public Boolean call() throws Exception {
             if (connection != null) {
-                connectionCloseThread = Thread.currentThread();
                 LOG.debug("in CloseConnectionTask.call(), calling connection.close()");
                 connection.close();
             }
-
-            return Boolean.TRUE;
+        } finally {
+            connection = null;
+            super.tearDown();
         }
     }
 


[2/2] activemq git commit: AMQ-6765 Add trace logging of start failure exception

Posted by ta...@apache.org.
AMQ-6765 Add trace logging of start failure exception

Log the exception at trace level when start fails.

(cherry picked from commit 56bed30c6427a1cc6b41e0d289a97c3e5b4582c4)


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

Branch: refs/heads/activemq-5.14.x
Commit: 42e4a6cd9902e63db26f4edc22dfca123df01fc8
Parents: 3b5a4d7
Author: Timothy Bish <ta...@gmail.com>
Authored: Tue Jul 11 15:43:32 2017 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Tue Jul 11 16:19:51 2017 -0400

----------------------------------------------------------------------
 .../org/apache/activemq/transport/http/HttpClientTransport.java     | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/42e4a6cd/activemq-http/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java b/activemq-http/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java
index 153e5d6..2480daa 100755
--- a/activemq-http/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java
@@ -281,6 +281,7 @@ public class HttpClientTransport extends HttpTransportSupport {
             httpClient.execute(httpMethod, new BasicResponseHandler());
             httpClient.execute(optionsMethod, handler);
         } catch(Exception e) {
+            LOG.trace("Error on start: ", e);
             throw new IOException("Failed to perform GET on: " + remoteUrl + " as response was: " + e.getMessage());
         }