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();