BigPic wrote: > > I'm using ActiveMQ 5.2.0 but I can't get clients to discover the broker. > My goal is to run a single broker with multiple clients all > auto-discovering it. > > I have the broker config: > > <transportConnectors> > <transportConnector name="openwire" > uri="tcp://localhost:61616" > discoveryUri="multicast://default?group=test"/> > </transportConnectors> > > and the broker is running on a Win2K system. > > Then on another system (Win XP SP3), I have a Java 1.5 client: > > String brokerUrl = > "discovery:(multicast://default)?group=test&maxReconnectAttempts=2"; > ActiveMQConnectionFactory connectionFactory = > new ActiveMQConnectionFactory(brokerUrl); > >
OK, found a few problems. #1 is that the client broker URL should be String brokerUrl = "discovery:(multicast://default?group=test)?maxReconnectAttempts=2"; #2 is that it appears the discovery agent isn't started until the first connection attempt and the connection attempt does not in any way wait for the discovery agent to be started before trying to connect, so the 2 reconnection attempts pass before the discovery agent discovers the broker. #3 is definitely a bug. If I use String brokerUrl = "discovery:(multicast://default?group=test)?maxReconnectAttempts=30&initialReconnectDelay=1000&useExponentialBackOff=false"; the connection still fails, and in far less than the 30 seconds that should be necessary to do 30 attempts with a 1000 ms (= 1 second) delay between attempts. To get a connection I need to have at least 10 reconnect attempts and set useExponentialBackOff=true. -- View this message in context: http://www.nabble.com/Multicast-Discovery-not-working-tp21344587p21484957.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.