Repository: activemq Updated Branches: refs/heads/activemq-5.14.x 22d5b51a0 -> 16de69502
AMQ-6610: Fixing JDBC test Durable destinations need to always be loaded on connector start (cherry picked from commit ef84db5e64b7a96a0c5c7271bd88642d940ba7a4) Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/16de6950 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/16de6950 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/16de6950 Branch: refs/heads/activemq-5.14.x Commit: 16de69502f80210d857e9992096f9493e0a67e16 Parents: 22d5b51 Author: Christopher L. Shannon (cshannon) <[email protected]> Authored: Mon Feb 27 07:34:22 2017 -0500 Committer: Christopher L. Shannon (cshannon) <[email protected]> Committed: Mon Feb 27 07:38:03 2017 -0500 ---------------------------------------------------------------------- .../java/org/apache/activemq/broker/BrokerService.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/16de6950/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java index 1df077e..a0aacaf 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -2591,7 +2591,8 @@ public class BrokerService implements Service { * @throws Exception */ public void startAllConnectors() throws Exception { - List<TransportConnector> al = new ArrayList<TransportConnector>(); + final Set<ActiveMQDestination> durableDestinations = getBroker().getDurableDestinations(); + List<TransportConnector> al = new ArrayList<>(); for (Iterator<TransportConnector> iter = getTransportConnectors().iterator(); iter.hasNext();) { TransportConnector connector = iter.next(); al.add(startTransportConnector(connector)); @@ -2629,7 +2630,7 @@ public class BrokerService implements Service { for (Iterator<NetworkConnector> iter = getNetworkConnectors().iterator(); iter.hasNext();) { final NetworkConnector connector = iter.next(); connector.setLocalUri(uri); - startNetworkConnector(connector, networkConnectorStartExecutor); + startNetworkConnector(connector, durableDestinations, networkConnectorStartExecutor); } if (networkConnectorStartExecutor != null) { // executor done when enqueued tasks are complete @@ -2653,10 +2654,16 @@ public class BrokerService implements Service { public void startNetworkConnector(final NetworkConnector connector, final ThreadPoolExecutor networkConnectorStartExecutor) throws Exception { + startNetworkConnector(connector, getBroker().getDurableDestinations(), networkConnectorStartExecutor); + } + + public void startNetworkConnector(final NetworkConnector connector, + final Set<ActiveMQDestination> durableDestinations, + final ThreadPoolExecutor networkConnectorStartExecutor) throws Exception { connector.setBrokerName(getBrokerName()); //set the durable destinations to match the broker if not set on the connector if (connector.getDurableDestinations() == null) { - connector.setDurableDestinations(getBroker().getDurableDestinations()); + connector.setDurableDestinations(durableDestinations); } String defaultSocketURI = getDefaultSocketURIString(); if (defaultSocketURI != null) {
