AsyncAutoCommitTransaction#addFuture() is used by #enqueue() to arrange for the postTransactionAction to be executed as each store transaction is completed asynchronously by the (BDB store's) commit-thread.
An optimisation in #addFuture means that an enqueue can 'jump-the-queue', and be enqueued before others that are already waiting in the future recorder list.
A problematic sequence would be:
1) Message 1 and Message 2 arrive from the wire (AMQProtocolEngine#received)
2) Message 1 begins processing. AsyncAutoCommitTransaction.enqueue called, but as commit thread is running behind, its enqueue action joins list of the future recorder (AMQChannel#_unfinishedCommandsQueue).
3) BDB commit thread catches up the backlog
4) Message 2 begins processing. AsyncAutoCommitTransaction.enqueue called but as the StoreFuture is already completed, its enqueue action is executed immediately so Message 2 is enqueued.
5) AMQProtocolEngine#complete calls receiveComplete() completing the actions in _unfinishedCommandsQueue. Message 1 is therefore enqueued.
6) Message 1 and Message 2 are now out of order. Message 2 will be delivered to a Consumer before Message 1.
private void addFuture(final StoreFuture future, final Action action)
if(action != null)