From 81c5b1500bc324e269ff462308094c6eda766021 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Tue, 2 Jan 2007 13:39:10 +0000 Subject: [PATCH] in stop() remove VMTransports after services stopped - to avoid a timing issue with discovery spinning up a new instance git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@491794 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/activemq/broker/BrokerService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java index 2f88ec9c5a..ac2f43ef50 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -395,6 +395,7 @@ public class BrokerService implements Service, Serializable { addShutdownHook(); log.info("Using Persistence Adapter: " + getPersistenceAdapter()); + if (deleteAllMessagesOnStartup) { deleteAllMessages(); } @@ -448,8 +449,7 @@ public class BrokerService implements Service, Serializable { stopAllConnectors(stopper); - //remove any VMTransports connected - VMTransportFactory.stopped(getBrokerName()); + stopper.stop(persistenceAdapter); @@ -476,7 +476,10 @@ public class BrokerService implements Service, Serializable { } stopper.stop(getManagementContext()); } - + //remove any VMTransports connected + //this has to be done after services are stopped, + //to avoid timimg issue with discovery (spinning up a new instance) + VMTransportFactory.stopped(getBrokerName()); log.info("ActiveMQ JMS Message Broker (" + getBrokerName()+", "+brokerId+") stopped"); stopper.throwFirstException(); @@ -1513,6 +1516,7 @@ public class BrokerService implements Service, Serializable { for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) { NetworkConnector connector = (NetworkConnector) iter.next(); + connector.setLocalUri(getVmConnectorURI()); connector.setBrokerName(getBrokerName()); connector.setDurableDestinations(getBroker().getDurableDestinations()); connector.start();