Class AsynchronousCommandBus

java.lang.Object
org.axonframework.commandhandling.SimpleCommandBus
org.axonframework.commandhandling.AsynchronousCommandBus
All Implemented Interfaces:
CommandBus, MessageDispatchInterceptorSupport<CommandMessage<?>>, MessageHandlerInterceptorSupport<CommandMessage<?>>

public class AsynchronousCommandBus extends SimpleCommandBus
Specialization of the SimpleCommandBus that processed Commands asynchronously from the calling thread. By default, the AsynchronousCommandBus uses a Cached Thread Pool (see Executors.newCachedThreadPool()). It will reuse threads while possible, and shut them down after 60 seconds of inactivity.

Each Command is dispatched in a separate task, which is processed by the Executor.

Note that you should call shutdown() to stop any threads waiting for new tasks. Failure to do so may cause the JVM to hang for up to 60 seconds on JVM shutdown.

Since:
1.3.4
Author:
Allard Buijze