Mark Anderson created AMQ-6144:
----------------------------------

             Summary: BrokerService.startTransportConnector should update 
transportConnectors if JMX is enabled 
                 Key: AMQ-6144
                 URL: https://issues.apache.org/jira/browse/AMQ-6144
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.13.0
            Reporter: Mark Anderson


I am programatically adding and removing TCP connectors to BrokerService where 
JMX is enabled.

I add the connector as follows:
{code}
unmanagedConnector = brokerService.addConnector(connectorUri);
managedConnector = brokerService.startTransportConnector(unmanagedConnector);
{code}

When removing the connector I would have expected the following to work:
{code}
brokerService.removeConnector(managedConnector);
{code}
However this method returns false since transportConnectors does not contain 
the managedConnector and the MBean will not be unregisted.

As a workaround I have to do the following:
{code}
brokerService.removeConnector(unmanagedConnector);
managedConnector.stop();
managedConnector.setBrokerService(null);
{code}
where the removeConnector call will actually unregister the managedConnector 
MBean.

When JMX is enabled should brokerService.startTransportConnector() replace the 
unmanaged connector in the set with the managed connector? Similar to how 
startAllConnectors clears and updates transportConnectors?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to