Active Durable Topic Consumer is not re-assigned to Topic after it is deleted and recreated -------------------------------------------------------------------------------------------
Key: AMQ-3678 URL: https://issues.apache.org/jira/browse/AMQ-3678 Project: ActiveMQ Issue Type: Bug Components: Broker Affects Versions: 5.5.1 Environment: Mac OS X (10.7.2) Reporter: Dominic Tootell Attachments: CountMessagesRecievedOnDurableTopicAfterTopicDeletion.java, Topic.patch.txt If I have a durable subscriber on a topic, which is *{{active}}*; and a message producer is sending to the topic. If the topic is deleted (whist the durable consumer is *{{active}}*), should the durable subscription be re-added to the topic (as a consumer) when it the TOPIC is subsequently recreated by the producer on the next message send? When replicating the above with a QUEUE that has an active consumer and producer. If you delete the queue whilst the producer and consumer are active, the next message sent by the producer recreates the QUEUE, and the active consumer is then registered as a consumer on the queue. However, this isn't the case for an active durable consumer (which isn't re-added as a consumer); when the TOPIC is subsequently recreated by the producer's next message to the topic. It could be the case that you should not be able to delete the topic, via jmx, when an active durable consumer is present? If so, then should this logic also apply to the queue? (not able to delete it via jmx when it has an active consumer). To re-attach the active durable consumer to the newly created topic, in - http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java You could apply the attached patch to the *{{public void addSubscription(ConnectionContext context, final Subscription sub) throws Exception }}* method (line 112) to re-add the durable consumer. (junit included) ---- A related question to the above is should the advisory - "ActiveMQ.Advisory.Consumer.Topic.XXX" or - "ActiveMQ.Advisory.Consumer.Queue.XXX" Be recreated when the active consumer reattaches to the queue or topic? When you remove, via jmx, the Queue or Topic the associated Consumer Advisory Topic is also removed. When the queue or topic is recreated, and the consumer re-assigned to the new queue; the advisory isn't created/fired. Would this cause any issues? Should an advisory be sent? does it affect *{{dynamicallyIncludedDestinations}}* and the use of the Advisories when using a network of brokers? cheers /dom -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira