try {
Executor ex = outMessage.getExchange().get(Executor.class);
if (ex == null) {
WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
.getExtension(WorkQueueManager.class);
AutomaticWorkQueue qu = mgr.getNamedWorkQueue("http-conduit");
if (qu == null) {
qu = mgr.getAutomaticWorkQueue();
}
long timeout = 5000;
if (policy != null && policy.isSetAsyncExecuteTimeout()) {
timeout = policy.getAsyncExecuteTimeout();
}
if (timeout > 0) {
qu.execute(runnable, timeout);
} else {
qu.execute(runnable);
}
} else {
outMessage.getExchange().put(Executor.class.getName()
+ ".USING_SPECIFIED", Boolean.TRUE);
ex.execute(runnable);