[2/2] activemq git commit: https://issues.apache.org/jira/browse/AMQ-6124 - fix and test - propagate broker info from prestarted backup transport

2016-01-14 Thread cshannon
https://issues.apache.org/jira/browse/AMQ-6124 - fix and test - propagate 
broker info from prestarted backup transport

(cherry picked from commit db1506a5921f70134c3b647cec51204f0e1c1416)


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

Branch: refs/heads/activemq-5.13.x
Commit: 741ee01e11f2805d84d45996f70996687026993c
Parents: aa8b644
Author: gtully 
Authored: Tue Jan 12 14:00:13 2016 +
Committer: Christopher L. Shannon (cshannon) 
Committed: Thu Jan 14 15:57:55 2016 +

--
 .../transport/failover/BackupTransport.java | 16 +++-
 .../transport/failover/FailoverTransport.java   |  1 +
 .../failover/FailoverClusterTestSupport.java|  6 ++
 .../transport/failover/FailoverPriorityTest.java|  5 -
 .../failover/FailoverTransportBackupsTest.java  | 15 +--
 5 files changed, 39 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq/blob/741ee01e/activemq-client/src/main/java/org/apache/activemq/transport/failover/BackupTransport.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/transport/failover/BackupTransport.java
 
b/activemq-client/src/main/java/org/apache/activemq/transport/failover/BackupTransport.java
index f6df0a4..9c591e2 100644
--- 
a/activemq-client/src/main/java/org/apache/activemq/transport/failover/BackupTransport.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/transport/failover/BackupTransport.java
@@ -18,6 +18,7 @@
 
 package org.apache.activemq.transport.failover;
 
+import org.apache.activemq.command.BrokerInfo;
 import org.apache.activemq.transport.DefaultTransportListener;
 import org.apache.activemq.transport.Transport;
 
@@ -29,10 +30,12 @@ class BackupTransport extends DefaultTransportListener{
private Transport transport;
private URI uri;
private boolean disposed;
-   
+   private BrokerInfo brokerInfo;
+
BackupTransport(FailoverTransport ft){
this.failoverTransport=ft;
}
+
@Override
 public void onException(IOException error) {
this.disposed=true;
@@ -41,6 +44,17 @@ class BackupTransport extends DefaultTransportListener{
}
}
 
+   @Override
+   public void onCommand(Object command) {
+   if (command instanceof BrokerInfo) {
+   brokerInfo = (BrokerInfo) command;
+   }
+   }
+
+   public BrokerInfo getBrokerInfo() {
+   return brokerInfo;
+   }
+
public Transport getTransport() {
return transport;
}

http://git-wip-us.apache.org/repos/asf/activemq/blob/741ee01e/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
 
b/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
index 7f7d7c6..dcb0867 100755
--- 
a/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
@@ -991,6 +991,7 @@ public class FailoverTransport implements 
CompositeTransport {
 backups.remove(bt);
 transport = bt.getTransport();
 uri = bt.getUri();
+myTransportListener.onCommand(bt.getBrokerInfo());
 if (priorityBackup && priorityBackupAvailable) {
 Transport old = 
this.connectedTransport.getAndSet(null);
 if (old != null) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/741ee01e/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTestSupport.java
--
diff --git 
a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTestSupport.java
 
b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTestSupport.java
index c5e9665..01dcce4 100644
--- 
a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverClusterTestSupport.java
+++ 

Jenkins build is still unstable: ActiveMQ-Java7 #915

2016-01-14 Thread Apache Jenkins Server
See 



Jenkins build is still unstable: ActiveMQ-Java7 » ActiveMQ :: Unit Tests #915

2016-01-14 Thread Apache Jenkins Server
See 




Jenkins build is back to stable : ActiveMQ-Java7 » ActiveMQ :: STOMP Protocol #915

2016-01-14 Thread Apache Jenkins Server
See 




buildbot success in ASF Buildbot on activemq-site-production

2016-01-14 Thread buildbot
The Buildbot has detected a restored build on builder activemq-site-production 
while building ASF Buildbot. Full details are available at:
http://ci.apache.org/builders/activemq-site-production/builds/4761

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'activemq-site-production' triggered 
this build
Build Source Stamp: [branch activemq/activemq-website] HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot





svn commit: r977682 - in /websites/production/activemq/content: apache-activemq-board-report-20161-january.html cache/main.pageCache

2016-01-14 Thread buildbot
Author: buildbot
Date: Thu Jan 14 12:22:05 2016
New Revision: 977682

Log:
Production update by buildbot for activemq

Modified:

websites/production/activemq/content/apache-activemq-board-report-20161-january.html
websites/production/activemq/content/cache/main.pageCache

Modified: 
websites/production/activemq/content/apache-activemq-board-report-20161-january.html
==
--- 
websites/production/activemq/content/apache-activemq-board-report-20161-january.html
 (original)
+++ 
websites/production/activemq/content/apache-activemq-board-report-20161-january.html
 Thu Jan 14 12:22:05 2016
@@ -72,7 +72,7 @@
   
 
 
-DescriptionApache ActiveMQ is a popular and powerful open source messaging 
server. Apache ActiveMQ is fast, supports many cross language clients and 
protocols, comes with easy to use enterprise integration patterns and many 
advanced features while fully supporting JMS 1.1, J2EE 1.4, AMQP 
1.0.ActivityTODO- the PMC MUST provide this 
informationPMC 
changesCurrently 20 PMC membersNo new 
PMC members added in the last 3 monthsLast PMC addition was 
Arthur Naseef on Mon Feb 09 2015Committer base 
changesCurrently 54 committersNo new 
committers added in the last 3 monthsLast committe
 r addition was Christopher L. Shannon at Thu Jul 30 
2015ReleasesActivemq-CPP 
v3.9.1 was released on Thu Dec 03 20155.11.3 was released on 
Sun Nov 01 20155.12.1 was released on Wed Oct 14 
20155.12.2 was released on Sun Jan 10 
20165.13.0 was released on Wed Dec 02 
2015ActiveMQ Artemis 1.2.0 was released on Thu Jan 07 
2016Mailing list activitymailto:us...@activemq.apache.org; 
rel="nofollow">us...@activemq.apache.org716 subscribers (down 
-5 in the last 3 months)815 emails sent to list (712 in previous 
quarter)mailto:d...@activemq.apache.org; 
rel="nofollow">d...@activemq.apache.org341 subscribers (up 7 in 
the last 3 months)742 emails sent to list (765 in pre
 vious quarter)mailto:iss...@activemq.apache.org; 
rel="nofollow">iss...@activemq.apache.org31 subscribers (up 4 
in the last 3 months)1890 emails sent to list (1763 in previous 
quarter)mailto:annou...@activemq.apache.org; 
rel="nofollow">annou...@activemq.apache.org9 subscribers (up 1 
in the last 3 months)JIRA 
activity214 JIRA tickets created in the last 3 
months227 JIRA tickets closed/resolved in the last 3 
months(Most of this information is pulled from https://reporter.apache.org/;>reporter.apache.org)
+DescriptionApache ActiveMQ is a popular and powerful open source messaging 
server. Apache ActiveMQ is fast, supports many cross language clients and 
protocols, comes with easy to use enterprise integration patterns and many 
advanced features while fully supporting JMS 1.1, J2EE 1.4, AMQP 
1.0.ActivityTODO- the PMC MUST provide this 
informationApache.NMS 
added a new provider implementation Apache.NMS.XMS for 
connecting to IBM WebSphere MQSeries. This was contributed by the user 
community, and based on the existing Apache.NMS provider implementation for 
TIBCO EMS. There are now eight NMS provider 
implementations.PMC changesCurrently 20 PMC membersNo new PMC members added 
in the last 3 monthsLast PMC addition was Arthur Naseef on Mon 
Feb 09 2015Committer base 
changesCurrently 54 committersNo new 
committers added in the last 3 monthsLast committer addition 
was Christopher L. Shannon at Thu Jul 30 
2015ReleasesActivemq-CPP 
v3.9.1 was released on Thu Dec 03 20155.11.3 was released on 
Sun Nov 01 20155.12.1 was released on Wed Oct 14 
20155.12.2 was released on Sun Jan 10 
20165.13.0 was released on Wed Dec 02 
2015ActiveMQ Artemis 1.2.0 was released on Thu Jan 07 
2016Mailing list activitymailto:us...@activemq.apache.org; 
rel="nofollow">us...@activemq.apache.org
 716 subscribers (down -5 in the last 3 months)815 emails sent 
to list (712 in previous quarter)mailto:d...@activemq.apache.org; 
rel="nofollow">d...@activemq.apache.org341 subscribers (up 7 in 
the last 3 months)742 emails sent to list (765 in previous 
quarter)mailto:iss...@activemq.apache.org; 
rel="nofollow">iss...@activemq.apache.org31 subscribers (up 4 
in the last 3 months)1890 emails sent to list (1763 in previous 
quarter)mailto:annou...@activemq.apache.org; 
rel="nofollow">annou...@activemq.apache.org9 subscribers (up 1 
in the last 3 months)JIRA 
activity214 JIRA tickets created in the last 3 
months227 JIRA tickets closed/resolved in the 
 last 3 months(Most of this information is pulled from https://reporter.apache.org/;>reporter.apache.org)
 
 
   

Modified: websites/production/activemq/content/cache/main.pageCache
==
Binary files - no diff available.




Jenkins build is still unstable: ActiveMQ-Java8 #582

2016-01-14 Thread Apache Jenkins Server
See 



Jenkins build is still unstable: ActiveMQ-Java8 » ActiveMQ :: Unit Tests #582

2016-01-14 Thread Apache Jenkins Server
See 




buildbot failure in ASF Buildbot on activemq-site-production

2016-01-14 Thread buildbot
The Buildbot has detected a new failure on builder activemq-site-production 
while building ASF Buildbot. Full details are available at:
http://ci.apache.org/builders/activemq-site-production/builds/4762

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'activemq-site-production' triggered 
this build
Build Source Stamp: [branch activemq/activemq-website] HEAD
Blamelist: 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot





[1/2] activemq git commit: Network of brokers on duplex mode reports InstanceAlreadyExistsException on already existing destinations

2016-01-14 Thread cshannon
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.13.x 543851ba5 -> 741ee01e1


Network of brokers on duplex mode reports InstanceAlreadyExistsException on 
already existing destinations

(cherry picked from commit 6b1e87410da4a2033c286fcaa758371e48da62ec)


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

Branch: refs/heads/activemq-5.13.x
Commit: aa8b64420be5734a8b70736dab4d037bf84af927
Parents: 543851b
Author: Altaflux 
Authored: Mon Jan 4 15:00:00 2016 -0600
Committer: Christopher L. Shannon (cshannon) 
Committed: Thu Jan 14 15:57:41 2016 +

--
 .../network/MBeanBridgeDestination.java | 144 ++-
 .../network/DuplexNetworkMBeanTest.java | 100 +++--
 2 files changed, 162 insertions(+), 82 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq/blob/aa8b6442/activemq-broker/src/main/java/org/apache/activemq/network/MBeanBridgeDestination.java
--
diff --git 
a/activemq-broker/src/main/java/org/apache/activemq/network/MBeanBridgeDestination.java
 
b/activemq-broker/src/main/java/org/apache/activemq/network/MBeanBridgeDestination.java
index bab5574..888d295 100644
--- 
a/activemq-broker/src/main/java/org/apache/activemq/network/MBeanBridgeDestination.java
+++ 
b/activemq-broker/src/main/java/org/apache/activemq/network/MBeanBridgeDestination.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,12 +16,6 @@
  */
 package org.apache.activemq.network;
 
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.management.ObjectName;
-
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.jmx.AnnotatedMBean;
 import org.apache.activemq.broker.jmx.BrokerMBeanSupport;
@@ -33,6 +27,11 @@ import org.apache.activemq.thread.Scheduler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.management.ObjectName;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
 public class MBeanBridgeDestination {
 private static final Logger LOG = 
LoggerFactory.getLogger(MBeanBridgeDestination.class);
 private final BrokerService brokerService;
@@ -41,9 +40,8 @@ public class MBeanBridgeDestination {
 private final NetworkBridgeConfiguration networkBridgeConfiguration;
 private final Scheduler scheduler;
 private final Runnable purgeInactiveDestinationViewTask;
-private Map destinationObjectNameMap = 
new ConcurrentHashMap();
-private Map 
outboundDestinationViewMap = new ConcurrentHashMap();
-private Map 
inboundDestinationViewMap = new ConcurrentHashMap();
+private final Map 
outboundDestinationViewMap = new ConcurrentHashMap<>();
+private final Map 
inboundDestinationViewMap = new ConcurrentHashMap<>();
 
 public MBeanBridgeDestination(BrokerService brokerService, 
NetworkBridgeConfiguration networkBridgeConfiguration, NetworkBridge bridge, 
NetworkBridgeView networkBridgeView) {
 this.brokerService = brokerService;
@@ -61,49 +59,48 @@ public class MBeanBridgeDestination {
 
 public void onOutboundMessage(Message message) {
 ActiveMQDestination destination = message.getDestination();
-NetworkDestinationView networkDestinationView = 
outboundDestinationViewMap.get(destination);
-if (networkDestinationView == null) {
-synchronized (destinationObjectNameMap) {
-if ((networkDestinationView = 
outboundDestinationViewMap.get(destination)) == null) {
-ObjectName bridgeObjectName = bridge.getMbeanObjectName();
-try {
-ObjectName 

buildbot success in ASF Buildbot on activemq-site-production

2016-01-14 Thread buildbot
The Buildbot has detected a restored build on builder activemq-site-production 
while building ASF Buildbot. Full details are available at:
http://ci.apache.org/builders/activemq-site-production/builds/4771

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'activemq-site-production' triggered 
this build
Build Source Stamp: [branch activemq/activemq-website] HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot





activemq git commit: https://issues.apache.org/jira/browse/AMQ-6117

2016-01-14 Thread tabish
Repository: activemq
Updated Branches:
  refs/heads/master 5adbafef3 -> 5b73ffad6


https://issues.apache.org/jira/browse/AMQ-6117

Test to try and reproduce the issue.

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

Branch: refs/heads/master
Commit: 5b73ffad6bd000fdad93bc473900b2374d36181a
Parents: 5adbafe
Author: Timothy Bish 
Authored: Thu Jan 14 18:28:08 2016 -0500
Committer: Timothy Bish 
Committed: Thu Jan 14 18:28:08 2016 -0500

--
 .../org/apache/activemq/bugs/AMQ6117Test.java   | 148 +++
 1 file changed, 148 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/activemq/blob/5b73ffad/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ6117Test.java
--
diff --git 
a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ6117Test.java 
b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ6117Test.java
new file mode 100644
index 000..e7d19fb
--- /dev/null
+++ 
b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ6117Test.java
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.bugs;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.openmbean.CompositeData;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.jmx.QueueViewMBean;
+import org.apache.activemq.broker.region.policy.PolicyEntry;
+import org.apache.activemq.broker.region.policy.PolicyMap;
+import org.apache.activemq.util.Wait;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ */
+public class AMQ6117Test {
+
+private static final Logger LOG = 
LoggerFactory.getLogger(AMQ6117Test.class);
+
+private BrokerService broker;
+
+@Test
+public void testViewIsStale() throws Exception {
+
+final int MSG_COUNT = 10;
+
+ActiveMQConnectionFactory cf = new 
ActiveMQConnectionFactory(broker.getVmConnectorURI());
+Connection connection = cf.createConnection();
+Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+Queue queue = session.createQueue("Test-Queue");
+Queue dlq = session.createQueue("ActiveMQ.DLQ");
+
+MessageProducer producer = session.createProducer(queue);
+
+// Ensure there is a DLQ in existence to start.
+session.createProducer(dlq);
+
+for (int i = 0; i < MSG_COUNT; ++i) {
+producer.send(session.createMessage(), DeliveryMode.PERSISTENT, 
Message.DEFAULT_PRIORITY, 1000);
+}
+
+final QueueViewMBean queueView = getProxyToQueue(dlq.getQueueName());
+
+assertTrue("Message should be DLQ'd", Wait.waitFor(new 
Wait.Condition() {
+
+@Override
+public boolean isSatisified() throws Exception {
+return queueView.getQueueSize() == MSG_COUNT;
+}
+}));
+
+LOG.info("DLQ has captured all expired messages");
+
+Deque browsed = new LinkedList();
+CompositeData[] elements = queueView.browse();
+assertEquals(MSG_COUNT, elements.length);
+
+for (CompositeData element : elements) {
+  

buildbot failure in ASF Buildbot on activemq-site-production

2016-01-14 Thread buildbot
The Buildbot has detected a new failure on builder activemq-site-production 
while building ASF Buildbot. Full details are available at:
http://ci.apache.org/builders/activemq-site-production/builds/4772

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'activemq-site-production' triggered 
this build
Build Source Stamp: [branch activemq/activemq-website] HEAD
Blamelist: 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot





Jenkins build is still unstable: ActiveMQ-Java7 #916

2016-01-14 Thread Apache Jenkins Server
See 



Jenkins build is still unstable: ActiveMQ-Java7 » ActiveMQ :: Unit Tests #916

2016-01-14 Thread Apache Jenkins Server
See 




Jenkins build is still unstable: ActiveMQ-Java8 » ActiveMQ :: Unit Tests #583

2016-01-14 Thread Apache Jenkins Server
See 




Jenkins build is still unstable: ActiveMQ-Java8 #583

2016-01-14 Thread Apache Jenkins Server
See 



activemq git commit: https://issues.apache.org/jira/browse/AMQ-6126

2016-01-14 Thread tabish
Repository: activemq
Updated Branches:
  refs/heads/master 928705533 -> ebcc1b4ea


https://issues.apache.org/jira/browse/AMQ-6126

Add more configuration options to TaskRunnerFactory

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

Branch: refs/heads/master
Commit: ebcc1b4eae194553e2e9764d9e0c337e0efc320f
Parents: 9287055
Author: Timothy Bish 
Authored: Thu Jan 14 10:41:56 2016 -0500
Committer: Timothy Bish 
Committed: Thu Jan 14 10:41:56 2016 -0500

--
 .../apache/activemq/thread/TaskRunnerFactory.java | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq/blob/ebcc1b4e/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
 
b/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
index ea1534f..2987997 100755
--- 
a/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
  * Manages the thread pool for long running tasks. Long running tasks are not
  * always active but when they are active, they may need a few iterations of
  * processing for them to become idle. The manager ensures that each task is
- * processes but that no one task overtakes the system. This is kinda like
+ * processes but that no one task overtakes the system. This is somewhat like
  * cooperative multitasking.
  *
  * @org.apache.xbean.XBean
@@ -51,7 +51,7 @@ public class TaskRunnerFactory implements Executor {
 private boolean dedicatedTaskRunner;
 private long shutdownAwaitTermination = 3;
 private final AtomicBoolean initDone = new AtomicBoolean(false);
-private int maxThreadPoolSize = Integer.MAX_VALUE;
+private int maxThreadPoolSize = getDefaultMaximumPoolSize();
 private RejectedExecutionHandler rejectedTaskHandler = null;
 private ClassLoader threadClassLoader;
 
@@ -166,7 +166,7 @@ public class TaskRunnerFactory implements Executor {
 }
 
 protected ExecutorService createDefaultExecutor() {
-ThreadPoolExecutor rc = new ThreadPoolExecutor(0, 
getMaxThreadPoolSize(), getDefaultKeepAliveTime(), TimeUnit.SECONDS, new 
SynchronousQueue(), new ThreadFactory() {
+ThreadPoolExecutor rc = new 
ThreadPoolExecutor(getDefaultCorePoolSize(), getMaxThreadPoolSize(), 
getDefaultKeepAliveTime(), TimeUnit.SECONDS, new SynchronousQueue(), 
new ThreadFactory() {
 @Override
 public Thread newThread(Runnable runnable) {
 String threadName = name + "-" + id.incrementAndGet();
@@ -182,14 +182,16 @@ public class TaskRunnerFactory implements Executor {
 LOG.error("Error in thread '{}'", t.getName(), e);
 }
 });
-
+
 LOG.trace("Created thread[{}]: {}", threadName, thread);
 return thread;
 }
 });
+
 if (rejectedTaskHandler != null) {
 rc.setRejectedExecutionHandler(rejectedTaskHandler);
 }
+
 return rc;
 }
 
@@ -269,6 +271,14 @@ public class TaskRunnerFactory implements Executor {
 this.shutdownAwaitTermination = shutdownAwaitTermination;
 }
 
+private static int getDefaultCorePoolSize() {
+return 
Integer.getInteger("org.apache.activemq.thread.TaskRunnerFactory.corePoolSize", 
0);
+}
+
+private static int getDefaultMaximumPoolSize() {
+return 
Integer.getInteger("org.apache.activemq.thread.TaskRunnerFactory.maximumPoolSize",
 Integer.MAX_VALUE);
+}
+
 private static int getDefaultKeepAliveTime() {
 return 
Integer.getInteger("org.apache.activemq.thread.TaskRunnerFactory.keepAliveTime",
 30);
 }



activemq git commit: https://issues.apache.org/jira/browse/AMQ-6126

2016-01-14 Thread tabish
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.13.x b32be1bb1 -> 543851ba5


https://issues.apache.org/jira/browse/AMQ-6126

Add more configuration options to TaskRunnerFactory
(cherry picked from commit ebcc1b4eae194553e2e9764d9e0c337e0efc320f)


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

Branch: refs/heads/activemq-5.13.x
Commit: 543851ba54fe624fac1245c5ef2859dc6db0af19
Parents: b32be1b
Author: Timothy Bish 
Authored: Thu Jan 14 10:41:56 2016 -0500
Committer: Timothy Bish 
Committed: Thu Jan 14 10:43:56 2016 -0500

--
 .../apache/activemq/thread/TaskRunnerFactory.java | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq/blob/543851ba/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
 
b/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
index ea1534f..2987997 100755
--- 
a/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
  * Manages the thread pool for long running tasks. Long running tasks are not
  * always active but when they are active, they may need a few iterations of
  * processing for them to become idle. The manager ensures that each task is
- * processes but that no one task overtakes the system. This is kinda like
+ * processes but that no one task overtakes the system. This is somewhat like
  * cooperative multitasking.
  *
  * @org.apache.xbean.XBean
@@ -51,7 +51,7 @@ public class TaskRunnerFactory implements Executor {
 private boolean dedicatedTaskRunner;
 private long shutdownAwaitTermination = 3;
 private final AtomicBoolean initDone = new AtomicBoolean(false);
-private int maxThreadPoolSize = Integer.MAX_VALUE;
+private int maxThreadPoolSize = getDefaultMaximumPoolSize();
 private RejectedExecutionHandler rejectedTaskHandler = null;
 private ClassLoader threadClassLoader;
 
@@ -166,7 +166,7 @@ public class TaskRunnerFactory implements Executor {
 }
 
 protected ExecutorService createDefaultExecutor() {
-ThreadPoolExecutor rc = new ThreadPoolExecutor(0, 
getMaxThreadPoolSize(), getDefaultKeepAliveTime(), TimeUnit.SECONDS, new 
SynchronousQueue(), new ThreadFactory() {
+ThreadPoolExecutor rc = new 
ThreadPoolExecutor(getDefaultCorePoolSize(), getMaxThreadPoolSize(), 
getDefaultKeepAliveTime(), TimeUnit.SECONDS, new SynchronousQueue(), 
new ThreadFactory() {
 @Override
 public Thread newThread(Runnable runnable) {
 String threadName = name + "-" + id.incrementAndGet();
@@ -182,14 +182,16 @@ public class TaskRunnerFactory implements Executor {
 LOG.error("Error in thread '{}'", t.getName(), e);
 }
 });
-
+
 LOG.trace("Created thread[{}]: {}", threadName, thread);
 return thread;
 }
 });
+
 if (rejectedTaskHandler != null) {
 rc.setRejectedExecutionHandler(rejectedTaskHandler);
 }
+
 return rc;
 }
 
@@ -269,6 +271,14 @@ public class TaskRunnerFactory implements Executor {
 this.shutdownAwaitTermination = shutdownAwaitTermination;
 }
 
+private static int getDefaultCorePoolSize() {
+return 
Integer.getInteger("org.apache.activemq.thread.TaskRunnerFactory.corePoolSize", 
0);
+}
+
+private static int getDefaultMaximumPoolSize() {
+return 
Integer.getInteger("org.apache.activemq.thread.TaskRunnerFactory.maximumPoolSize",
 Integer.MAX_VALUE);
+}
+
 private static int getDefaultKeepAliveTime() {
 return 
Integer.getInteger("org.apache.activemq.thread.TaskRunnerFactory.keepAliveTime",
 30);
 }



activemq git commit: https://issues.apache.org/jira/browse/AMQ-6108

2016-01-14 Thread tabish
Repository: activemq
Updated Branches:
  refs/heads/master ebcc1b4ea -> 5adbafef3


https://issues.apache.org/jira/browse/AMQ-6108

Ensure that executor threads are created as daemon threads, fix a
try/finaly block, clean up some warnings.  

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

Branch: refs/heads/master
Commit: 5adbafef3b9ec05de7186caa9112f3639c7a6253
Parents: ebcc1b4
Author: Timothy Bish 
Authored: Thu Jan 14 16:47:23 2016 -0500
Committer: Timothy Bish 
Committed: Thu Jan 14 16:47:23 2016 -0500

--
 .../activemq/transport/nio/SelectorManager.java |  4 +-
 .../transport/nio/SelectorSelection.java|  3 +-
 .../activemq/transport/nio/SelectorWorker.java  | 52 +---
 3 files changed, 28 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq/blob/5adbafef/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
index 8469bac..1adb92f 100644
--- 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
@@ -50,8 +50,8 @@ public final class SelectorManager {
 
 @Override
 public Thread newThread(Runnable runnable) {
-this.i++;
-final Thread t = new Thread(runnable, "ActiveMQ NIO Worker 
" + this.i);
+Thread t = new Thread(runnable, "ActiveMQ NIO Worker " + 
(i++));
+t.setDaemon(false);
 return t;
 }
 });

http://git-wip-us.apache.org/repos/asf/activemq/blob/5adbafef/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
index 01480a0..a0dd210 100644
--- 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
@@ -86,8 +86,9 @@ public final class SelectorSelection {
 try {
 key.cancel();
 } catch (CancelledKeyException e) {
+} finally {
+worker.release();
 }
-worker.release();
 }
 });
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5adbafef/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
index e55e378..1a32346 100644
--- 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
@@ -35,7 +35,7 @@ public class SelectorWorker implements Runnable {
 
 final AtomicInteger retainCounter = new AtomicInteger(1);
 private final ConcurrentLinkedQueue ioTasks = new 
ConcurrentLinkedQueue();
-   
+
 public SelectorWorker(SelectorManager manager) throws IOException {
 this.manager = manager;
 selector = Selector.open();
@@ -57,20 +57,19 @@ public class SelectorWorker implements Runnable {
 manager.onWorkerNotFullEvent(this);
 }
 }
-
+
 boolean isReleased() {
-return retainCounter.get()==0;
+return retainCounter.get() == 0;
 }
 
-
 public void addIoTask(Runnable work) {
 ioTasks.add(work);
 selector.wakeup();
 }
-
+
 private void processIoTasks() {
-Runnable task; 
-while( (task= ioTasks.poll()) !=null ) {
+Runnable task;
+while ((task = ioTasks.poll()) != null) {
 try {
 task.run();
 } catch (Throwable e) {
@@ -79,34 +78,33 @@ public class SelectorWorker implements Runnable {
 }
 }
 
-
-
+@Override
   

activemq git commit: https://issues.apache.org/jira/browse/AMQ-6108

2016-01-14 Thread tabish
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.13.x 741ee01e1 -> 1d9fdbcbe


https://issues.apache.org/jira/browse/AMQ-6108

Ensure that executor threads are created as daemon threads, fix a
try/finaly block, clean up some warnings.
(cherry picked from commit 5adbafef3b9ec05de7186caa9112f3639c7a6253)


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

Branch: refs/heads/activemq-5.13.x
Commit: 1d9fdbcbeaacf2d5673bb5435b1caae0b1cfc7a7
Parents: 741ee01
Author: Timothy Bish 
Authored: Thu Jan 14 16:47:23 2016 -0500
Committer: Timothy Bish 
Committed: Thu Jan 14 16:47:59 2016 -0500

--
 .../activemq/transport/nio/SelectorManager.java |  4 +-
 .../transport/nio/SelectorSelection.java|  3 +-
 .../activemq/transport/nio/SelectorWorker.java  | 52 +---
 3 files changed, 28 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq/blob/1d9fdbcb/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
index 8469bac..1adb92f 100644
--- 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java
@@ -50,8 +50,8 @@ public final class SelectorManager {
 
 @Override
 public Thread newThread(Runnable runnable) {
-this.i++;
-final Thread t = new Thread(runnable, "ActiveMQ NIO Worker 
" + this.i);
+Thread t = new Thread(runnable, "ActiveMQ NIO Worker " + 
(i++));
+t.setDaemon(false);
 return t;
 }
 });

http://git-wip-us.apache.org/repos/asf/activemq/blob/1d9fdbcb/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
index 01480a0..a0dd210 100644
--- 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
@@ -86,8 +86,9 @@ public final class SelectorSelection {
 try {
 key.cancel();
 } catch (CancelledKeyException e) {
+} finally {
+worker.release();
 }
-worker.release();
 }
 });
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/1d9fdbcb/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
--
diff --git 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
index e55e378..1a32346 100644
--- 
a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
+++ 
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
@@ -35,7 +35,7 @@ public class SelectorWorker implements Runnable {
 
 final AtomicInteger retainCounter = new AtomicInteger(1);
 private final ConcurrentLinkedQueue ioTasks = new 
ConcurrentLinkedQueue();
-   
+
 public SelectorWorker(SelectorManager manager) throws IOException {
 this.manager = manager;
 selector = Selector.open();
@@ -57,20 +57,19 @@ public class SelectorWorker implements Runnable {
 manager.onWorkerNotFullEvent(this);
 }
 }
-
+
 boolean isReleased() {
-return retainCounter.get()==0;
+return retainCounter.get() == 0;
 }
 
-
 public void addIoTask(Runnable work) {
 ioTasks.add(work);
 selector.wakeup();
 }
-
+
 private void processIoTasks() {
-Runnable task; 
-while( (task= ioTasks.poll()) !=null ) {
+Runnable task;
+while ((task = ioTasks.poll()) != null) {
 try {
 task.run();
 } catch (Throwable e) {
@@ -79,34 +78,33 @@ public