From bc344c96279f3165da86c57fed6945e85378ce5a Mon Sep 17 00:00:00 2001 From: James Strachan Date: Tue, 18 Jul 2006 05:56:19 +0000 Subject: [PATCH] auto-create destinations when consumers are added to the broker (assuming auto-create is enabled) to help implement Virtual Topics.. For more background see: http://www.nabble.com/Re%3A-Virtual-Topics-%28was-Re%3A-Failover-topic-subscribers%29-tf1942508.html#a5332644 git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@422978 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/broker/region/AbstractRegion.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java index 3192f559ab..3770aafefa 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java @@ -154,6 +154,12 @@ abstract public class AbstractRegion implements Region { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { log.debug("Adding consumer: "+info.getConsumerId()); + ActiveMQDestination destination = info.getDestination(); + if (destination != null && ! destination.isPattern() && ! destination.isComposite()) { + // lets auto-create the destination + lookup(context, destination); + } + Subscription sub = createSubscription(context, info); // We may need to add some destinations that are in persistent store but not active