Hello,
I am trying to develop a network of Brokers in which one broker is connected
to two other brokers. I am using NetworkConnector to connect. I am using the
following code :-
BrokerService brokerService=null;
brokerService.setBrokerName("broker1");
brokerService.setPersistent(false);
brokerService.setUseShutdownHook(false);
brokerService.addConnector("tcp://" + brokerHost + ":" + brokerPort);
NetworkConnector connector1;
connector1 =
brokerService.addNetworkConnector("static://"+"tcp://localhost:" +61612);
connector1.setName("C1");
connector1.setDuplex(true);
connector1.setNetworkTTL(2);
connector1 =
brokerService.addNetworkConnector("static://"+"tcp://localhost:" +61613);
connector1.setName("C2");
connector1.setDuplex(true);
connector1.setNetworkTTL(2);
brokerService.start();
When I try to connect the same broker to the second port 61613, it gives me
an exception javax.management.InstanceAlreadyExistsException
What am i doing wrong. Can i use the same NetworkConnector object to connect
a broker with two other brokers.
Please reply....?
--
View this message in context:
http://www.nabble.com/Connectinfg-a-Broker-to-Multiple-Brokers-tp25757201p25757201.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.