Reviewing the performance characteristics of the Java Broker showed a number of opportunities for improvement.
this JIRA covers
1) Reducing the creation of QueueRunners/SubFlushRunners so that only one object is created per queue/subscription and is simply rescheduled if need be
2) Increase the number of messages processed by each async loop from 10 to 40
3) Detecting at the point of enqueue whether the queue is an exclusive queue (likely a topic) or whether asynchronous delivery is already taking place. In this case we can skip over the attempt to deliver synchronously on enqueue.
4) Allow the deferring of flushing the send buffer to the network until the entire incoming buffer has been processed. By flushing for every message delivered we were being needlessly inefficient for small message sized - by allowing the flush to be called only at the end of processing the incoming data we retain the same guarantees, but allow more efficient IO