The code you're envisioning could only work if run within the broker process; to the best of my knowledge, you can't do what you're describing from a client process. That begs the question of how you'd give your code control to be able to run in the first place; maybe a custom broker plugin that listens for socket connections to tell it about changes to the list of brokers, or that watches a file listing all the brokers for changes?
It's probably possible, but it's likely to require you to spend some quality time with the ActiveMQ code. If that's not appealing, you could consider other options such as using a hub-and-spoke topology with duplex networkConnectors from the spoke to the hub, so that no broker needs to know about any broker other than the hub. Tim On Sep 1, 2017 8:44 AM, "yogu13" <[email protected]> wrote: > Hello, > > I have a question on setting up network of brokers dynamically i.e. not via > usual static configuration via XML. To explain my scenario we have a > discovery server which can tell how many broker instances are available > (running) within an environment, We use programmatic API for configuring > ActiveMQ Broker so configuring network of brokers using this information > should be fairly easy. However I am curious once ActiveMQ Broker is > configured and running and if we want to scale then can we add a new > ActiveMQ broker's network configuration to already started BrokerService ? > > In ActiveMQ API what I mean is > > BrokerService broker = new BrokerService(); > // some activemq configuration > ... > ... > broker.start() > > broker.addNetworkConnector("static:(tcp://10.x.x.x:62001)").start(); // > not > sure if this would work > > I cannot use Multicast as its disabled and I wanted to avoid configuring > all > possible network connectors up front. > > Thank you! > > Regards, > -Yogesh > > > > > -- > Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User- > f2341805.html >
