// local VMTransport dispatcher is artificially delayed.
final TaskRunnerFactory realTaskRunnerFactory = localBroker
.getTaskRunnerFactory();
localBroker.setTaskRunnerFactory(new TaskRunnerFactory() {
public TaskRunner createTaskRunner(Task task, String name) {
final TaskRunner realTaskRunner = realTaskRunnerFactory
.createTaskRunner(task, name);
if (name.startsWith("ActiveMQ Connection Dispatcher: ")) {
return new TaskRunner() {
@Override
public void shutdown() throws InterruptedException {