Deferring Acknowledges and Commits Using AUTO_ACK for Non-Durable Subscribers

Best Practices for Application Design 3-5 – No store configured implies using the default persistent store that is available on each targeted WebLogic Server instance – Store configured implies no-override. ■ Non-durable subscribers only: – If there are no subscribers, or there are only non-durable subscribers for a topic, the messages will be downgraded to non-persistent. Because non-durable subscribers exist only for the life of the JMS server, there is no reason to persist the message. ■ Temporary destinations: – Because temporary destinations exist only for the lifetime of their host JMS server, there is no reason to persist their messages. WebLogic JMS automatically forces all messages in a temporary destination to non-persistent. Durable subscribers require a persistent store to be configured on their JMS server, even if they receive only non-persistent messages. A durable subscription is persisted to ensure that it continues through a server restart, as required by the JMS specification.

3.8 Deferring Acknowledges and Commits

Because sends are generally faster than receives, consider reducing the overhead associated with receives by deferring acknowledgment of messages until several messages have been received and can be acknowledged collectively. If you are using transactions substitute the word commit for acknowledge. Deferment of acknowledgements is not likely to improve performance for non-durable subscriptions, however, because of internal optimizations already in place. It may not be possible to implement deferred acknowledgements for asynchronous listeners. If an asynchronous listener acknowledges only every 10 messages, but for some reason receives only 5, then the last few messages may not be acknowledged. One possible solution is to have the asynchronous consumer post synchronous, non-blocking receives from within its onMessage callback to receive subsequent messages. Another possible solution is to have the listener start a timer that, when triggered, sends a message to the listeners destination in order to wake it up and complete the outstanding work that has not yet been acknowledged—provided the wake-up message can be directed solely at the correct listener.

3.9 Using AUTO_ACK for Non-Durable Subscribers

Non-durable, non-transactional topic subscribers are optimized to store local copies of the message on the client side, thus reducing network overhead when acknowledgements are being issued. This optimization yields a 10-20 performance improvement, where the improvement is more evident under higher subscriber loads. One side effect of this optimization, particularly for high numbers of concurrent topic subscribers, is the overhead of client-side garbage collection, which can degrade performance for message subscriptions. To prevent such degradation, we recommended allocating a larger heap size on the subscriber client. For example, in a test of 100 concurrent subscribers running in 10 JVMs, it was found that giving clients an initial and maximum heap size of 64MB for each JVM was sufficient. 3-6 Programming JMS for Oracle WebLogic Server

3.10 Alternative Qualities of Service, Multicast and No-Acknowledge