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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact