From adefa46afc7e0479995bdb2fe7e46adb8bf26067 Mon Sep 17 00:00:00 2001 From: Alex Rudyy Date: Fri, 6 Mar 2015 11:39:14 +0000 Subject: QPID-6434: [Java Client] Update existing JMS client documentation for AMQP 0.8/0.9.x to cover the effect of setting maxprefetch to 0 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1664592 13f79535-47bb-0310-9956-ffa450edef68 --- .../jms-client-0-8/JMS-Client-Understanding.xml | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/qpid/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml b/qpid/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml index b750c8e19c..fdef79c22c 100644 --- a/qpid/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml +++ b/qpid/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml @@ -326,6 +326,33 @@ amqp://guest:guest@clientid/?brokerlist='localhost:5671?key_store='/path/to/app1 Session#SESSION_TRANSACTED ) or received messages are acknowledged (for Session#CLIENT_ACKNOWLEDGE). + + Settings maxprefetch to 0 ( either globally via JVM system property + max_prefetch + or on a connection level as a connection option + maxprefetch ) + switches off the pre-fetching functionality. With maxprefetch=0 messages are fetched one by one without caching on the client. + + + + Setting maxprefetch to 0 is recommended in sping-jms-based applications when + DefaultMassgeListenerContainer is configured with CachingConnectionFactory + and has cacheLevel set to either CACHE_CONSUMER or CACHE_SESSION + and dynamic consumer scaling (concurrentConsumers!=maxConcurrentConsumers). With such configuration + DefaultMassgeListenerContainer can create new MessageConsumer + invokers and delete existing MessageConsumer invokers dynamically. On deletion of + MessageConsumer invoker, its JMS Session and MessageConsumer + are closed. However, with CachingConnectionFactory JMS Session + proxy objects are used and when method close of session proxy is invoked, the real Qpid + JMS Session object is not get closed. It can be returned into the session cache in active state. + If maxprefetch is not 0, the cached Qpid Session might have prefetched messages and + it even might continue prefetching of the messages until its prefetch limit is reached. As result, + because of prefetched messages being stack in not used cached Session, + the message flow between client and broker can stop making an impression as if message consumption is hang. + Setting maxprefetch to 0 prevents this problem from occurring. + SingleConnectionFactory should be used with maxprefetch>0. + +
TemporaryQueues -- cgit v1.2.1