activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r650766 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: BrokerService.java region/virtual/MirroredQueue.java
Date Wed, 23 Apr 2008 07:10:23 GMT
Author: rajdavies
Date: Wed Apr 23 00:10:22 2008
New Revision: 650766

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

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/virtual/MirroredQueue.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=650766&r1=650765&r2=650766&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
Wed Apr 23 00:10:22 2008
@@ -152,6 +152,7 @@
     private boolean keepDurableSubsActive = true;
     private boolean useVirtualTopics = true;
     private boolean useMirroredQueues = false;
+    private boolean useTempMirroredQueues=true;
     private BrokerId brokerId;
     private DestinationInterceptor[] destinationInterceptors;
     private ActiveMQDestination[] destinations;
@@ -1303,6 +1304,14 @@
             int timeBeforePurgeTempDestinations) {
         this.timeBeforePurgeTempDestinations = timeBeforePurgeTempDestinations;
     }
+    
+    public boolean isUseTempMirroredQueues() {
+        return useTempMirroredQueues;
+    }
+
+    public void setUseTempMirroredQueues(boolean useTempMirroredQueues) {
+        this.useTempMirroredQueues = useTempMirroredQueues;
+    }
 	//
     // Implementation methods
     // -------------------------------------------------------------------------
@@ -1902,4 +1911,5 @@
     public void setRegionBroker(Broker regionBroker) {
         this.regionBroker = regionBroker;
     }
+
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/virtual/MirroredQueue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/virtual/MirroredQueue.java?rev=650766&r1=650765&r2=650766&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/virtual/MirroredQueue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/virtual/MirroredQueue.java
Wed Apr 23 00:10:22 2008
@@ -44,25 +44,27 @@
 
     public Destination intercept(final Destination destination) {
         if (destination.getActiveMQDestination().isQueue()) {
-            try {
-                final Destination mirrorDestination = getMirrorDestination(destination);
-                if (mirrorDestination != null) {
-                    return new DestinationFilter(destination) {
-                        public void send(ProducerBrokerExchange context, Message message)
throws Exception {
-                            message.setDestination(mirrorDestination.getActiveMQDestination());
-                            mirrorDestination.send(context, message);
-
-                            if (isCopyMessage()) {
-                                message = message.copy();
+            if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues())
{
+                try {
+                    final Destination mirrorDestination = getMirrorDestination(destination);
+                    if (mirrorDestination != null) {
+                        return new DestinationFilter(destination) {
+                            public void send(ProducerBrokerExchange context, Message message)
throws Exception {
+                                message.setDestination(mirrorDestination.getActiveMQDestination());
+                                mirrorDestination.send(context, message);
+    
+                                if (isCopyMessage()) {
+                                    message = message.copy();
+                                }
+                                message.setDestination(destination.getActiveMQDestination());
+                                super.send(context, message);
                             }
-                            message.setDestination(destination.getActiveMQDestination());
-                            super.send(context, message);
-                        }
-                    };
+                        };
+                    }
+                }
+                catch (Exception e) {
+                    LOG.error("Failed to lookup the mirror destination for: " + destination
+ ". Reason: " + e, e);
                 }
-            }
-            catch (Exception e) {
-                LOG.error("Failed to lookup the mirror destination for: " + destination +
". Reason: " + e, e);
             }
         }
         return destination;



Mime
View raw message