You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by kapasars <ka...@yahoo.com> on 2010/08/25 04:05:40 UTC

network of brokers topics are not being forwarded to other borkers

I am building proof of concept to have 3 brokers, all connected to each
other, and forwarding one topic messages to each other. Also wanted to do
all in java instead of config files. In activemg 5.3.2 servers do not
connect to each other in 5.4 they but if I publish a message the message is
not published to other servers.

I'm kind of at a loss why this happens and any suggestion much appreciated.
instance 1:
name: my_test_server_1
connectorURL: tcp://localhost:6060
netconnURL: [tcp://localhost:6060,tcp://localhost:6061,tcp://localhost:6062]

instance 2:
name: my_test_server_2
connectorURL: tcp://localhost:6060
netconnURL: [tcp://localhost:6060,tcp://localhost:6061,tcp://localhost:6062]

public MyEmbededBroker(String name, String connectorURL, String[]
netconnURL) throws Exception{
		BrokerService broker = new BrokerService();
		broker.setBrokerName(name);
		broker.addConnector(connectorURL);
		broker.setPersistent(true);
		broker.setUseJmx(false);
		broker.setAdvisorySupport(true);
		
		for(String connection : netconnURL){
			if(!connectorURL.equals(connection)){
				System.out.println("adding conector "+connection);
				DiscoveryNetworkConnector dconn = new DiscoveryNetworkConnector(new
URI("static:("+connection+")?useExponentialBackOff=false"));
				//dconn.setName("beachnetwork_"+connection);
				dconn.setDuplex(false);
				dconn.setNetworkTTL(4);
				//dconn.setDynamicOnly(true);
				dconn.setConduitSubscriptions(false);
				dconn.setDispatchAsync(true);
				dconn.setPrefetchSize(1);
				broker.addNetworkConnector(dconn);
				
			}
		}
		broker.start();
}

If I publish a message to a topic that all servers have subscribed only
server it was published receives it, no copy is sent to others.

http://old.nabble.com/file/p29528110/TestMessageProducer.java
TestMessageProducer.java 
http://old.nabble.com/file/p29528110/SyncServer.java SyncServer.java 
http://old.nabble.com/file/p29528110/MyEmbededBroker.java
MyEmbededBroker.java 
-- 
View this message in context: http://old.nabble.com/network-of-brokers-topics-are-not-being-forwarded-to-other-borkers-tp29528110p29528110.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.