You never need to add the vm transport: broker.addConnector("vm://localhost:61616");
it gets created/destroyed on the fly. Also make sure the all the brokers have unique broker names. And all the steps you are doing are done automatically using the peer transport [1]. Like: new ActiveMQConnectionFactory("peer://group-a/broker-a"); Starts up an embedded broker named broker-a and configures it to join the group-a multicast broker group. [1] http://activemq.apache.org/peer-transport-reference.html On Dec 13, 2007 8:36 AM, Mathieu Guillaume <[EMAIL PROTECTED]> wrote: > > I'm trying to set up multiple clients, each one with its own embedded > broker to which it talks in-VM, and to have all the brokers connected in > a network through multicast discovery. I need to do this > programmatically (so no xml configuration). > > I'm testing this with just two nodes so far, but the brokers don't seem > to see each other. > Is the following code correct to create my brokers? > > > broker=new BrokerService(); > broker.setUseJmx(true); > broker.setPersistent(false); > > /* set up VM connector for the local client */ > broker.addConnector("vm://localhost:61616"); > > /* set up discovery and TCP connector for remote brokers */ > TransportConnector transport=new TransportConnector(); > transport.setConnectUri(new java.net.URI("tcp://localhost:0")); > transport.setDiscoveryUri(new java.net.URI("multicast://default")); > broker.addConnector(transport); > > broker.addNetworkConnector("multicast://default"); > > broker.start(); > > -- Regards, Hiram Blog: http://hiramchirino.com Open Source SOA http://open.iona.com