Description
Method unregisterDestination in ManagedRegionBroker is supposed to remove the SlowConsumerStrategy MBean on the destination it removes if one exists but the code is incorrect and will never actually do so.
protected void unregisterDestination(ObjectName key) throws Exception { DestinationView view = null; removeAndRemember(topics, key, view); removeAndRemember(queues, key, view); removeAndRemember(temporaryQueues, key, view); removeAndRemember(temporaryTopics, key, view); if (registeredMBeans.remove(key)) { try { managementContext.unregisterMBean(key); } catch (Throwable e) { LOG.warn("Failed to unregister MBean: " + key); LOG.debug("Failure reason: " + e, e); } } if (view != null) { key = view.getSlowConsumerStrategy(); if (key!= null && registeredMBeans.remove(key)) { try { managementContext.unregisterMBean(key); } catch (Throwable e) { LOG.warn("Failed to unregister slow consumer strategy MBean: " + key); LOG.debug("Failure reason: " + e, e); } } } }
Attempts to pass the DestinationView into removeAndRemember() as an 'out' parameter so it never ends up getting set to anything and the last if will never be executed because view will always be null.