// Setup a destination policy where it takes lots of message at a time.
// so that slave does not block first as there is no producer flow control
// on the master connector
PolicyMap policyMap = new PolicyMap();
PolicyEntry policy = new PolicyEntry();
// don't apply the same memory limit as the master in this case
//policy.setMemoryLimit(10);
policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
policy.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
policy.setProducerFlowControl(true);
policyMap.setDefaultEntry(policy);
slave.setDestinationPolicy(policyMap);
slave.setMasterConnectorURI(connector.getConnectUri().toString());
slave.start();