answer.setSchedulerSupport(true);
answer.setPersistent(true);
answer.setDeleteAllMessagesOnStartup(true);
answer.setUseJmx(withJMX);
RedeliveryPlugin redeliveryPlugin = new RedeliveryPlugin();
RedeliveryPolicyMap redeliveryPolicyMap = new RedeliveryPolicyMap();
RedeliveryPolicy defaultEntry = new RedeliveryPolicy();
defaultEntry.setInitialRedeliveryDelay(5000);
defaultEntry.setMaximumRedeliveries(5);
redeliveryPolicyMap.setDefaultEntry(defaultEntry);
redeliveryPlugin.setRedeliveryPolicyMap(redeliveryPolicyMap);
answer.setPlugins(new BrokerPlugin[] {redeliveryPlugin});
TransportConnector transportConnector =
answer.addConnector("tcp://localhost:0");