activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1387851 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java
Date Thu, 20 Sep 2012 04:05:27 GMT
Author: tabish
Date: Thu Sep 20 04:05:26 2012
New Revision: 1387851

URL: http://svn.apache.org/viewvc?rev=1387851&view=rev
Log:
fix for: https://issues.apache.org/jira/browse/AMQ-4065

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java?rev=1387851&r1=1387850&r2=1387851&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/IndividualDeadLetterStrategy.java
Thu Sep 20 04:05:26 2012
@@ -34,15 +34,17 @@ public class IndividualDeadLetterStrateg
 
     private String topicPrefix = "ActiveMQ.DLQ.Topic.";
     private String queuePrefix = "ActiveMQ.DLQ.Queue.";
+    private String topicSuffix;
+    private String queueSuffix;
     private boolean useQueueForQueueMessages = true;
     private boolean useQueueForTopicMessages = true;
     private boolean destinationPerDurableSubscriber;
 
     public ActiveMQDestination getDeadLetterQueueFor(Message message, Subscription subscription)
{
         if (message.getDestination().isQueue()) {
-            return createDestination(message, queuePrefix, useQueueForQueueMessages, subscription);
+            return createDestination(message, queuePrefix, queueSuffix, useQueueForQueueMessages,
subscription);
         } else {
-            return createDestination(message, topicPrefix, useQueueForTopicMessages, subscription);
+            return createDestination(message, topicPrefix, topicSuffix, useQueueForTopicMessages,
subscription);
         }
     }
 
@@ -71,6 +73,28 @@ public class IndividualDeadLetterStrateg
         this.topicPrefix = topicPrefix;
     }
 
+    public String getQueueSuffix() {
+        return queueSuffix;
+    }
+
+    /**
+     * Sets the suffix to use for all dead letter queues for queue messages
+     */
+    public void setQueueSuffix(String queueSuffix) {
+        this.queueSuffix = queueSuffix;
+    }
+
+    public String getTopicSuffix() {
+        return topicSuffix;
+    }
+
+    /**
+     * Sets the suffix to use for all dead letter queues for topic messages
+     */
+    public void setTopicSuffix(String topicSuffix) {
+        this.topicSuffix = topicSuffix;
+    }
+
     public boolean isUseQueueForQueueMessages() {
         return useQueueForQueueMessages;
     }
@@ -113,6 +137,7 @@ public class IndividualDeadLetterStrateg
     // -------------------------------------------------------------------------
     protected ActiveMQDestination createDestination(Message message,
                                                     String prefix,
+                                                    String suffix,
                                                     boolean useQueue,
                                                     Subscription subscription ) {
         String name = null;
@@ -129,10 +154,15 @@ public class IndividualDeadLetterStrateg
         if (destinationPerDurableSubscriber && subscription instanceof DurableTopicSubscription)
{
             name += "." + ((DurableTopicSubscription)subscription).getSubscriptionKey();
         }
+
+        if (suffix != null && !suffix.isEmpty()) {
+            name += suffix;
+        }
+
         if (useQueue) {
             return new ActiveMQQueue(name);
         } else {
             return new ActiveMQTopic(name);
         }
     }
-}
+}
\ No newline at end of file



Mime
View raw message