{
brokerService1 = new BrokerService();
brokerService1.setBrokerName("consumer");
brokerService1.setUseJmx(false);
brokerService1.setPersistenceAdapter(new MemoryPersistenceAdapter());
broker1Uri = brokerService1.addConnector("tcp://0.0.0.0:0").getPublishableConnectString();
brokerService1.start();
}
{
brokerService2 = new BrokerService();
brokerService2.setBrokerName("producer");
brokerService2.setUseJmx(false);
brokerService2.setPersistenceAdapter(new MemoryPersistenceAdapter());
broker2Uri = brokerService2.addConnector("tcp://0.0.0.0:0").getPublishableConnectString();
NetworkConnector network2 = brokerService2.addNetworkConnector("static:("+broker1Uri+")");
network2.setName("network1");
network2.setDynamicOnly(true);
network2.setConduitSubscriptions(conduitSubscriptions);