To follow up I figured out that brokerService.startTransport was actually returning a managed transport and this was the one I should be stopping. The client connections then all failed as expected.
The Javadocs on BrokerService could definitely be better in this area. However, I did then run into an issue with removeConnector which I filed at https://issues.apache.org/jira/browse/AMQ-6144 On Tue, 26 Jan 2016 at 09:55 Mark Anderson <manderso...@gmail.com> wrote: > With ActiveMQ 5.13.0 I'm programattically adding and removing a > TcpTransportConnector as follows. The connectorUri is tcp://0.0.0.0:24726 > > Add > > connector = brokerService.addConnector(connectorUri); > brokerService.startTransportConnector(connector); > > Remove > > brokerService.removeConnector(connector); > connector.stop(); > connector.setBrokerService(null); > > However, I'm finding that after I remove the connector any client > connections that were made to that transport are still established and > functioning (i.e. messages are still being sent and received). > > Is this the expected behaviour? I would have though that removing and > stopping a connector would also automatically close any client connections. > > Thanks, > Mark >