AMQ-6610: Fixing JDBC test

Durable destinations need to always be loaded on connector start

(cherry picked from commit ef84db5e64)
This commit is contained in:
Christopher L. Shannon (cshannon) 2017-02-27 07:34:22 -05:00
parent 22d5b51a0c
commit 16de69502f
1 changed files with 10 additions and 3 deletions

View File

@ -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) {