activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1364973 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Date Tue, 24 Jul 2012 10:49:47 GMT
Author: gtully
Date: Tue Jul 24 10:49:47 2012
New Revision: 1364973

URL: http://svn.apache.org/viewvc?rev=1364973&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3696 - fix regression in FailoverStaticNetworkTest,
in jvm slave overwriting broker registry entry of master

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=1364973&r1=1364972&r2=1364973&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Tue Jul 24 10:49:47 2012
@@ -520,9 +520,14 @@ public class BrokerService implements Se
             if (isUseJmx()) {
                 startManagementContext();
             }
-            BrokerRegistry.getInstance().bind(getBrokerName(), BrokerService.this);
+            // in jvm master slave, lets not publish over existing broker till we get the
lock
+            final BrokerRegistry brokerRegistry = BrokerRegistry.getInstance();
+            if (brokerRegistry.lookup(getBrokerName()) == null) {
+                brokerRegistry.bind(getBrokerName(), BrokerService.this);
+            }
             startPersistenceAdapter(startAsync);
             startBroker(startAsync);
+            brokerRegistry.bind(getBrokerName(), BrokerService.this);
         } catch (Exception e) {
             LOG.error("Failed to start ActiveMQ JMS Message Broker (" + getBrokerName() +
", " + brokerId + "). Reason: " + e, e);
             try {



Mime
View raw message