activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r675484 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java
Date Thu, 10 Jul 2008 09:27:13 GMT
Author: rajdavies
Date: Thu Jul 10 02:27:09 2008
New Revision: 675484

URL: http://svn.apache.org/viewvc?rev=675484&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1848

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java?rev=675484&r1=675483&r2=675484&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
Thu Jul 10 02:27:09 2008
@@ -431,10 +431,15 @@
                                 break;
                             case ConsumerInfo.DATA_STRUCTURE_TYPE:
                             	localStartedLatch.await();
-                                if (!addConsumerInfo((ConsumerInfo)command)) {
-                                    if (LOG.isDebugEnabled()) {
-                                        LOG.debug("Ignoring ConsumerInfo: " + command);
+                                if (started.get()) {
+                                    if (!addConsumerInfo((ConsumerInfo) command)) {
+                                        if (LOG.isDebugEnabled()) {
+                                            LOG.debug("Ignoring ConsumerInfo: "+ command);
+                                        }
                                     }
+                                } else {
+                                    // received a subscription whilst stopping
+                                    LOG.warn("Stopping - ignoring ConsumerInfo: "+ command);
                                 }
                                 break;
                             default:

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java?rev=675484&r1=675483&r2=675484&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java
Thu Jul 10 02:27:09 2008
@@ -34,7 +34,7 @@
 public class DuplexNetworkMBeanTest extends TestCase {
 
     protected static final Log LOG = LogFactory.getLog(DuplexNetworkMBeanTest.class);
-    protected final int numRestarts = 2;
+    protected final int numRestarts = 10;
 
     protected BrokerService createBroker() throws Exception {
         BrokerService broker = new BrokerService();
@@ -48,7 +48,7 @@
         BrokerService broker = new BrokerService();
         broker.setBrokerName("networkedBroker");
         broker.addConnector("tcp://localhost:62617");
-        NetworkConnector networkConnector = broker.addNetworkConnector("static://tcp://localhost:61617");
+        NetworkConnector networkConnector = broker.addNetworkConnector("static:(tcp://localhost:61617)?maxReconnectDelay=1000&useExponentialBackOff=false");
         networkConnector.setDuplex(true);
         return broker;
     }
@@ -87,7 +87,7 @@
         for (int i=0; i<numRestarts; i++) {
             broker = createBroker();
             broker.start();
-            assertEquals(1, countMbeans(networkedBroker, "NetworkBridge", 5000));
+            assertEquals(1, countMbeans(networkedBroker, "NetworkBridge", 10000));
             assertEquals(1, countMbeans(broker, "Connection"));
             
             broker.stop();



Mime
View raw message