[ 
https://issues.apache.org/jira/browse/AMQ-9692?focusedWorklogId=1001872&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1001872
 ]

ASF GitHub Bot logged work on AMQ-9692:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jan/26 20:38
            Start Date: 26/Jan/26 20:38
    Worklog Time Spent: 10m 
      Work Description: cshannon commented on code in PR #1484:
URL: https://github.com/apache/activemq/pull/1484#discussion_r2729166892


##########
activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java:
##########
@@ -260,16 +260,21 @@ protected List<Subscription> 
addSubscriptionsForDestination(ConnectionContext co
     }
 
     @Override
-    public void removeDestination(ConnectionContext context, 
ActiveMQDestination destination, long timeout)
-            throws Exception {
-
+    public void removeDestination(ConnectionContext context, 
ActiveMQDestination destination, long timeout) throws Exception {
         // No timeout.. then try to shut down right way, fails if there are
         // current subscribers.
         if (timeout == 0) {
             for (Iterator<Subscription> iter = 
subscriptions.values().iterator(); iter.hasNext();) {
                 Subscription sub = iter.next();
                 if (sub.matches(destination) ) {
-                    throw new JMSException("Destination: " + destination + " 
still has an active subscription: " + sub);
+                    if(sub.isWildcard()) {
+                        var dest = destinations.get(destination);
+                        if(dest != null && 
dest.isGcWithOnlyWildcardConsumers()) {

Review Comment:
   There's a long list of things that are like this where we may want to 
revisit for AMQ 7 where we want to change default behavior or settings but it's 
technically a breaking change so a major version is more appropriate. I guess 
whether or not we change this to check active producers depends on if we 
consider it a bug or not.
   
   If we change it I would think by default this would share the same logic as 
the isActive and GC check and that should block removal by default even by an 
admin through JMX/console etc to prevent mistakes. But, if we do that we could 
add a force flag that would allow an administrator to force delete, but all of 
this is kind of out scope of the work for this. 





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1001872)
    Time Spent: 3h 20m  (was: 3h 10m)

> Support destination gc sweep of destinations with wild card consumers
> ---------------------------------------------------------------------
>
>                 Key: AMQ-9692
>                 URL: https://issues.apache.org/jira/browse/AMQ-9692
>             Project: ActiveMQ
>          Issue Type: Improvement
>            Reporter: Matt Pavlovich
>            Assignee: Matt Pavlovich
>            Priority: Minor
>             Fix For: 6.3.0, 5.19.2
>
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> Currently, a wild-card consumer can hold up a destination from being 
> automatically garbage collected. This change would add a policyEntry setting 
> to allow garbage collection if the destination only has wild card consumers



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to