Well. Let me explain how it works here:
* We call `doStart()`. if endpoint is not `active`, we activate it and send a `ListenerTask` to the `taskExecutor`
* `ListenerTask#run()` start infinite loop until `active` will become `false`
* If `popMessageAndSend()` throws exception we leave the loop and go to the `finally` block.
* Here we check `active` one more time to be sure that we really have to `restart()` the `ListenerTask`
* if `doStop()` will be called at the same time, we start new task anyway (keep in mind it's atomic), but it stops immediately, because the first condition of loop is check `active` atomic variable. 

You should understand that there is some timeframe, where we call `doStop()` behind the lock, but we receive one message before the endpoint will check `active` on the next loop iteration.