String options = new String("?useJmx=false&deleteAllMessagesOnStartup=true");
createAndConfigureBroker(new URI("broker:(tcp://localhost:61616)/BrokerA" + options));
createAndConfigureBroker(new URI("broker:(tcp://localhost:61617)/BrokerB" + options));
// Setup broker networks
NetworkConnector nc1 = bridgeBrokers("BrokerA", "BrokerB", dynamicOnly, networkTTL, conduit);
nc1.setDecreaseNetworkConsumerPriority(decreaseNetworkConsumerPriority);
nc1.setSuppressDuplicateQueueSubscriptions(suppressDuplicateQueueSubscriptions);
nc1.addDynamicallyIncludedDestination(ActiveMQDestination.createDestination("global.>", ActiveMQDestination.QUEUE_TYPE));
nc1.addDynamicallyIncludedDestination(ActiveMQDestination.createDestination("global.>", ActiveMQDestination.TOPIC_TYPE));
nc1.addDynamicallyIncludedDestination(ActiveMQDestination.createDestination("Consumer.>", ActiveMQDestination.QUEUE_TYPE));
NetworkConnector nc2 = bridgeBrokers("BrokerB", "BrokerA", dynamicOnly, networkTTL, conduit);
nc2.setDecreaseNetworkConsumerPriority(decreaseNetworkConsumerPriority);
nc2.setSuppressDuplicateQueueSubscriptions(suppressDuplicateQueueSubscriptions);
nc2.addDynamicallyIncludedDestination(ActiveMQDestination.createDestination("global.>", ActiveMQDestination.QUEUE_TYPE));
nc2.addDynamicallyIncludedDestination(ActiveMQDestination.createDestination("global.>", ActiveMQDestination.TOPIC_TYPE));
}