Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6ADA918EDB for ; Mon, 25 May 2015 09:50:38 +0000 (UTC) Received: (qmail 56577 invoked by uid 500); 25 May 2015 09:50:35 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 56552 invoked by uid 500); 25 May 2015 09:50:35 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 56543 invoked by uid 99); 25 May 2015 09:50:35 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 May 2015 09:50:35 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 34AB5AC055A for ; Mon, 25 May 2015 09:50:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1681574 - in /qpid/java/trunk/doc/book/src/jms-client-0-8: JMS-Client-Appendix-PooledConnectionFactory.xml JMS-Client-Book.xml JMS-Client-Understanding.xml Date: Mon, 25 May 2015 09:50:35 -0000 To: commits@qpid.apache.org From: kwall@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150525095035.34AB5AC055A@hades.apache.org> Author: kwall Date: Mon May 25 09:50:34 2015 New Revision: 1681574 URL: http://svn.apache.org/r1681574 Log: QPID-6534: [Java Broker Documentation] Move pool docs into separate annex and correct a couple of typos and improve formatting Added: qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-PooledConnectionFactory.xml Modified: qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Book.xml qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml Added: qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-PooledConnectionFactory.xml URL: http://svn.apache.org/viewvc/qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-PooledConnectionFactory.xml?rev=1681574&view=auto ============================================================================== --- qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-PooledConnectionFactory.xml (added) +++ qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-PooledConnectionFactory.xml Mon May 25 09:50:34 2015 @@ -0,0 +1,101 @@ + + +%entities; +]> + + + + PooledConnectionFactory + Qpid client provides PooledConnectionFactory which is a special + implementation of ConnectionFactory supporting Connection pooling. + The PooledConnectionFactory caches a predefined number of connections + thus saving an application which connects frequently time. The Connection + instance is taken from the pool whenever method + PooledConnectionFactory#createConnection() is invoked and returned into the + pool when method Connection#close() is called. + A user can configure a maximum allowed number of connections to remain in pool (10 by + default) by calling PooledConnectionFactory#setMaxPoolSize(int). When number + of connections exceeds the value set for maximum pool size, + PooledConnectionFactory starts to work as a normal ConnectionFactory and creates + a new connection every time method PooledConnectionFactory#createConnection() + is invoked. + The Connection URL is set by invoking + method PooledConnectionFactory#setConnectionURLString(String). + A user can specify the maximum time a connection may remain idle in pool by calling + PooledConnectionFactory#setConnectionTimeout(long) passing a value in + milliseconds. If connection is not used within the specified interval it is closed + automatically. + This implementation can be useful in Spring JMS based applications. An + example below demonstrates how to configure PooledConnectionFactory in the + Spring xml configuration. + Example of configuring <emphasis>PooledConnectionFactory</emphasis> in spring xml + configuration. + + + + + + + +]]> + + + + PooledConnectionFactory spring bean can be configured with such + spring-jms beans like + DefaultMessageListenerContainer and JmsTemplate. The + example below demonstrates how to do that + Examples of configuring <emphasis>PooledConnectionFactory</emphasis> with + <emphasis>DefaultMessageListenerContainer</emphasis> and + <emphasis>JmsTemplate</emphasis>. + + + + + + + + + + + +]]> + + + + If using DefaultMessageListenerContainer with + cacheLevel set to NONE it is important that + maxConcurrentConsumer does not exceed the value of maximum pool size set + on PooledConnectionFactory bean. If this is not the case, once the number + of in-use connections reaches the the PooledConnectionFactory#maxPoolSize + a new connection will be opened for each and every message receipt i.e. a connection per + message anti-pattern. + + Modified: qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Book.xml URL: http://svn.apache.org/viewvc/qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Book.xml?rev=1681574&r1=1681573&r2=1681574&view=diff ============================================================================== --- qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Book.xml (original) +++ qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Book.xml Mon May 25 09:50:34 2015 @@ -40,7 +40,8 @@ - + + Modified: qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml URL: http://svn.apache.org/viewvc/qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml?rev=1681574&r1=1681573&r2=1681574&view=diff ============================================================================== --- qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml (original) +++ qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Understanding.xml Mon May 25 09:50:34 2015 @@ -65,7 +65,9 @@ The examples in the previous chapter illustrated the Java code required to create the InitialContext and an example properties file. - Note that the Qpid Broker does not present a JNDI interface to the application. + The Qpid JMS client also provides an alternate connection factory implementation providing a + connection pool. This can be useful when utilsing frameworks such as Spring. + .
JNDI overview @@ -74,6 +76,7 @@
+ Note that the Qpid Broker does not present a JNDI interface to the application.
Connection @@ -593,71 +596,4 @@ amqp://guest:guest@clientid/?brokerlist= queue. and topic. prefix to create Queues and Topics objects respectively.
-
- PooledConnectionFactory - Qpid client provides PooledCollectionFactory which is a special - implementation of ConnectionFactory - allowing Connection pooling. - - - The PooledCollectionFactory can cache a predefined number of connections - saving the application time required to establish the connectivity. The Connection - instance is taken from a pool when method PooledCollectionFactory#createConnection() - is invoked and returned into a pool when method Connection#close() is called. - A user can configure a maximum allowed number of connections to retain in pool by calling - PooledCollectionFactory#setMaxPoolSize(int). When number of connections exceeds the value - set for maximum pool size (10 by default), PooledCollectionFactory starts working - as ordinary ConnectionFactory and - creates a new connection every time when method PooledCollectionFactory#createConnection() - is invoked. The Connection URL can be set by invoking method - PooledCollectionFactory#setConnectionURLString(String). A user can set a connection time - to remain open in pool (in milliseconds) by calling PooledCollectionFactory#setConnectionTimeout(long). - If pooled Connection is not used during specified interval it is get closed automatically. - - This implementation can be handy in spring-jms based applications. An example below - demonstrates how to configure PooledCollectionFactory in spring xml configuration. - - Example of configuring <emphasis>PooledCollectionFactory</emphasis> in spring xml configuration. - - - - - - - -]]> - - - - PooledCollectionFactory spring bean can be configured with such - spring-jms beans like DefaultMessageListenerContainer and - JmsTemplate. An example below demonstrates how to do that - - Examples of configuring <emphasis>PooledCollectionFactory</emphasis> with - <emphasis>DefaultMessageListenerContainer</emphasis> and <emphasis>JmsTemplate</emphasis>. - - - - - - - - - - - -]]> - - - - Please note, that with DefaultMessageListenerContainer having cachLevel - set to NONE the value set for maxConcurrentConsumer should not exceed - a value for maximum pool size set on PooledCollectionFactory bean, otherwise, after reaching - a number of connections above PooledCollectionFactory#maxPoolSize a new connection will - be opened on each message receipt. - - -
--------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org