activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1153588 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/broker/region/ main/java/org/apache/activemq/network/ test/java/org/apache/activemq/usecases/
Date Wed, 03 Aug 2011 17:26:21 GMT
Author: gtully
Date: Wed Aug  3 17:26:15 2011
New Revision: 1153588

URL: http://svn.apache.org/viewvc?rev=1153588&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3353 - fix regression in NoDuplicateOnTopicNetworkTest,
suppression only relevant to active durable subs

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NoDuplicateOnTopicNetworkTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java?rev=1153588&r1=1153587&r2=1153588&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
Wed Aug  3 17:26:15 2011
@@ -270,7 +270,7 @@ public class DurableTopicSubscription ex
 
     
     public synchronized String toString() {
-        return "DurableTopicSubscription-" + getSubscriptionKey() + ", id=" + info.getConsumerId()
+ ", destinations=" + destinations.size() + ", total=" + enqueueCounter + ", pending="
+        return "DurableTopicSubscription-" + getSubscriptionKey() + ", id=" + info.getConsumerId()
+ ", active=" + isActive() + ", destinations=" + destinations.size() + ", total=" + enqueueCounter
+ ", pending="
                + getPendingQueueSize() + ", dispatched=" + dispatchCounter + ", inflight="
+ dispatched.size() + ", prefetchExtension=" + this.prefetchExtension;
     }
 

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=1153588&r1=1153587&r2=1153588&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
Wed Aug  3 17:26:15 2011
@@ -1048,7 +1048,11 @@ public abstract class DemandForwardingBr
             List<ConsumerId> networkConsumers = sub.getConsumerInfo().getNetworkConsumerIds();
             if (!networkConsumers.isEmpty()) {
                 if (matchFound(candidateConsumers, networkConsumers)) {
-                    suppress = isActiveDurableSub(sub) && hasLowerPriority(sub, candidate.getLocalInfo());
+                    if (isInActiveDurableSub(sub)) {
+                        suppress = false;
+                    } else {
+                        suppress = hasLowerPriority(sub, candidate.getLocalInfo());
+                    }
                     break;
                 }
             }
@@ -1056,8 +1060,8 @@ public abstract class DemandForwardingBr
         return suppress;
     }
 
-    private boolean isActiveDurableSub(Subscription sub) {
-        return  (sub.getConsumerInfo().isDurable() && sub instanceof DurableTopicSubscription
&& ((DurableTopicSubscription)sub).isActive());
+    private boolean isInActiveDurableSub(Subscription sub) {
+        return  (sub.getConsumerInfo().isDurable() && sub instanceof DurableTopicSubscription
&& !((DurableTopicSubscription)sub).isActive());
     }
 
     private boolean hasLowerPriority(Subscription existingSub, ConsumerInfo candidateInfo)
{
@@ -1067,7 +1071,7 @@ public abstract class DemandForwardingBr
             if (LOG.isDebugEnabled()) {
                 LOG.debug(configuration.getBrokerName() + " Ignoring duplicate subscription
from " + remoteBrokerName
                         + ", sub: " + candidateInfo + " is duplicated by network subscription
with equal or higher network priority: " 
-                        + existingSub.getConsumerInfo()  + ", networkComsumerIds: " + existingSub.getConsumerInfo().getNetworkConsumerIds());
+                        + existingSub  + ", networkConsumerIds: " + existingSub.getConsumerInfo().getNetworkConsumerIds());
             }
             suppress = true;
         } else {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NoDuplicateOnTopicNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NoDuplicateOnTopicNetworkTest.java?rev=1153588&r1=1153587&r2=1153588&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NoDuplicateOnTopicNetworkTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NoDuplicateOnTopicNetworkTest.java
Wed Aug  3 17:26:15 2011
@@ -117,7 +117,7 @@ public class NoDuplicateOnTopicNetworkTe
     private BrokerService createAndStartBroker(String name, String addr)
             throws Exception {
         BrokerService broker = new BrokerService();
-        //broker.setDeleteAllMessagesOnStartup(true);
+        broker.setDeleteAllMessagesOnStartup(true);
         broker.setBrokerName(name);
         broker.addConnector(addr).setDiscoveryUri(new URI(MULTICAST_DEFAULT));
         broker.setUseJmx(false);



Mime
View raw message