if (executor == null || SynchronousExecutor.isA(executor)) {
// need true asynchrony
Bus bus = message.getExchange().get(Bus.class);
if (bus != null) {
WorkQueueManager workQueueManager =
bus.getExtension(WorkQueueManager.class);
Executor autoWorkQueue =
workQueueManager.getNamedWorkQueue("ws-addressing");
executor = autoWorkQueue != null
? autoWorkQueue
: workQueueManager.getAutomaticWorkQueue();
} else {
executor = OneShotAsyncExecutor.getInstance();
}
}
message.getExchange().put(Executor.class, executor);