OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add multiple network connectors dynamically


Just wanted to update that eventually I added the network connectors 
not with the proxy (BrokerViewMBean), but with the broker itself
(BrokerService).
This is the code that adds a new network connector (similar to how
activemq code handles a new network connector):
 

NetworkConnector networkConnector =
m_broker.addNetworkConnector(friendBrokerUrl);
        networkConnector.setName(DEFAULT_NETWORK_CONNECTOR_NAME + "_" +
friendBrokerName + "_" + serviceName.toLowerCase());
        networkConnector.setLocalUri(m_broker.getVmConnectorURI());
        networkConnector.setBrokerName(m_broker.getBrokerName());
       
networkConnector.setDurableDestinations(m_broker.getBroker().getDurableDestinations());
        if(m_broker.getDefaultSocketURIString() != null) {
           
networkConnector.setBrokerURL(m_broker.getDefaultSocketURIString());
        }

        // register network connector MBean
        m_broker.registerNetworkConnectorMBean(networkConnector);

        // start network connector
        networkConnector.start();



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html