JMS
Close resources (e.g., connections, session objects, producers, and consumers) when you’re finished with them.
Start the consumer before the producer so that the initial messages do not need to queue as they wait for the consumer.
Use separate transactional sessions and nontransactional sessions.
Use nonpersistent messages, as they are faster than persistent messages.
Use shorter messages, as longer messages take longer to deliver and process.
Specify the lowest redelivery count and time-to-live that the application can accept.
Maximize message throughput by tuning the delivery capacity.
Use asynchronous reception of messages with the
MessageListenerinterface.Process messages simultaneously with
ConnectionConsumersandServerSessionPools.Throttle very high-volume message delivery to a rate the consumers can handle. Use load-balanced message queues if necessary.
Duplicate-delivery mode is the fastest possible delivery mode, followed by auto-acknowledgment mode. Try to avoid client acknowledgment mode.
Use publish-and-subscribe for large numbers of active listeners, and point-to-point connections for few active listeners.