tConnector.setUri(new URI(uri1));
tConnector.setName(brokerName + ".transportConnector");
brokerService.addConnector(tConnector);
if (uri2 != null) {
final NetworkConnector nc = new DiscoveryNetworkConnector(new URI("static:" + uri2 + "," + uri3 + "," + uri4));
nc.setBridgeTempDestinations(true);
nc.setBrokerName(brokerName);
// When using queue limits set this to 1
nc.setPrefetchSize(1000);
nc.setNetworkTTL(1);
brokerService.addNetworkConnector(nc);
}
return brokerService;
}