You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cs...@apache.org on 2022/11/17 19:40:16 UTC

[activemq] branch main updated: AMQ-9157 - Add missing dispatched advisory topic to getAllDestinationAdvisoryTopics() method in AdvisorySupport

This is an automated email from the ASF dual-hosted git repository.

cshannon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f9a35eb2 AMQ-9157 - Add missing dispatched advisory topic to getAllDestinationAdvisoryTopics() method in AdvisorySupport
9f9a35eb2 is described below

commit 9f9a35eb29089cea29d3cadc0397b562a92a2045
Author: Christopher L. Shannon (cshannon) <ch...@gmail.com>
AuthorDate: Thu Nov 17 09:16:07 2022 -0500

    AMQ-9157 - Add missing dispatched advisory topic to getAllDestinationAdvisoryTopics() method in AdvisorySupport
    
    Adds missing dispached advisory topics to getAllDestinationAvisoryTopics()
    method in AdvisorySupport which is used to clean up on destination removal
    and also a note about virtual destination consumer advisories
---
 .../main/java/org/apache/activemq/advisory/AdvisorySupport.java    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/activemq-client/src/main/java/org/apache/activemq/advisory/AdvisorySupport.java b/activemq-client/src/main/java/org/apache/activemq/advisory/AdvisorySupport.java
index 5aee0c886..a3a468e58 100644
--- a/activemq-client/src/main/java/org/apache/activemq/advisory/AdvisorySupport.java
+++ b/activemq-client/src/main/java/org/apache/activemq/advisory/AdvisorySupport.java
@@ -94,6 +94,12 @@ public final class AdvisorySupport {
     public static ActiveMQTopic[] getAllDestinationAdvisoryTopics(ActiveMQDestination destination) throws JMSException {
         ArrayList<ActiveMQTopic> result = new ArrayList<ActiveMQTopic>();
 
+        //Note - Sicne this method is primarily used for removing destinations and clean up
+        //don't add VirtualDestinationConsumerAdvisoryTopic here as we want to keep listening
+        //for demand on composite destinations that may be forwarded for Virtual topics even after dest removal.
+        //This is because virtual destinations or composite destinations can trigger demand so we need to still listen
+        //Cleanup will happen automatically if there are no consumers on the advisory (due to the bridge
+        //no longer including the destination) when the inactive GC task runs
         result.add(getConsumerAdvisoryTopic(destination));
         result.add(getProducerAdvisoryTopic(destination));
         result.add(getExpiredMessageTopic(destination));
@@ -103,6 +109,7 @@ public final class AdvisorySupport {
         result.add(getMessageDiscardedAdvisoryTopic(destination));
         result.add(getMessageDeliveredAdvisoryTopic(destination));
         result.add(getMessageConsumedAdvisoryTopic(destination));
+        result.add(getMessageDispatchedAdvisoryTopic(destination));
         result.add(getMessageDLQdAdvisoryTopic(destination));
         result.add(getFullAdvisoryTopic(destination));