[
https://issues.apache.org/jira/browse/AMQ-9692?focusedWorklogId=1001857&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1001857
]
ASF GitHub Bot logged work on AMQ-9692:
---------------------------------------
Author: ASF GitHub Bot
Created on: 26/Jan/26 19:58
Start Date: 26/Jan/26 19:58
Worklog Time Spent: 10m
Work Description: mattrpav commented on code in PR #1484:
URL: https://github.com/apache/activemq/pull/1484#discussion_r2729018265
##########
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:
Would this also need to look for the same for network-only subscribers for
consistency? Or better yet perhaps re-use the isActive() or canGC() methods?
Note: This method is invoked by the RegionBroker gc check _after_ confirming
the expiration rules apply for the given destination.
In the case of GC, this is a repeat of the check.
In the case of an admin operation (ie via CLI or JMX) this is the only check
to prevent deleting a destination w/ active subscribers.
Issue Time Tracking
-------------------
Worklog Id: (was: 1001857)
Time Spent: 2h 50m (was: 2h 40m)
> 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: 2h 50m
> 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