Description
ActiveMQSessionExecutor::dispatch gets a consumer and calls consumer's dispatch method without holding any locks in between. This leaves a window when a consumer can be no longer valid on a dispatch call causing a crash.
Since this is a timing issue it is hard to demonstrate as such. If one adds let's say one second sleep in ActiveMQSessionExecutor::dispatch before the call to the consumer->dispatch, and destroys a consumer on a destination which has messages incoming will likely crash the application.