broker.setPersistent(true);
broker.setUseJmx(true);
broker.setAdvisorySupport(false);
broker.setDeleteAllMessagesOnStartup(true);
AMQPersistenceAdapter persistence = new AMQPersistenceAdapter();
persistence.setSyncOnWrite(false);
File directory = new File("target" + File.separator + "activemq-data");
persistence.setDirectory(directory);
File tmpDir = new File(directory, "tmp");
IOHelper.deleteChildren(tmpDir);
PListStore tempStore = new PListStore();
tempStore.setDirectory(tmpDir);
tempStore.start();