Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 74363 invoked from network); 30 Sep 2008 16:24:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Sep 2008 16:24:02 -0000 Received: (qmail 77358 invoked by uid 500); 30 Sep 2008 16:23:59 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 77342 invoked by uid 500); 30 Sep 2008 16:23:59 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 77331 invoked by uid 99); 30 Sep 2008 16:23:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 09:23:59 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 16:22:58 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Kki0Z-0006vS-LN for users@activemq.apache.org; Tue, 30 Sep 2008 09:23:31 -0700 Message-ID: <19745537.post@talk.nabble.com> Date: Tue, 30 Sep 2008 09:23:31 -0700 (PDT) From: janylj To: users@activemq.apache.org Subject: Re: Sending message using JmsTemplate with PooledConnectionFactory hangs periodically In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: janylj@gmail.com References: <19734135.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Thanks a lot, Ari. If the problem appears to be fixed, do you (or ActiveMQ folks) know where the problem is? Is it caused by PooledConnectionFactory, since I don't see any bug fix about PooledConnectionFactory in 5.2. Jan Ari Miller-2 wrote: > > I experienced similar issues using the same classes. I couldn't get > around > them, so I upgraded to the tentative 5.2 activemq release candidate ( > http://www.nabble.com/-VOTE--ActiveMQ-5.2.0---RC1-td19411389.html), which > fixed a number of bugs that might have caused this behavior ( > http://issues.apache.org/activemq/browse/AMQ/fixforversion/11841). > I load tested with the 5.2 release candidate this weekend, and found that > the message delivery was evenly distributed (no jamming/release by next > message) and that it handled load without stalling out. > > Best, > Ari > > On Mon, Sep 29, 2008 at 5:13 PM, janylj wrote: > >> >> My producer uses Spring's JmsTemplate with PooledConnectionFactory. The >> Spring configuration is below. Then I send 10 messages every second. And >> I >> notice that the producer doesn't send message smoothly. Every so often it >> would hang for a couple of seconds and then a huge spike of load would >> come >> in. For my application, the prompt response time is important. I am >> expecting smooth throughtput rate instead of big up and downs. Any inputs >> on >> the problem? >> >> > class="org.apache.activemq.pool.PooledConnectionFactory" >> destroy-method="stop"> >> >> >> >> >> >> >> >> > class="org.springframework.jms.core.JmsTemplate"> >> >> >> >> >> >> >> >> >> I am also wondering whether the implementation of PooledConnectionFactory >> is >> correct. The reason is that from my profiler, it maxed out 100 >> connections >> very very soon. And default number of sessions on a single connection is >> 500. The strange thing is that actually there were only 100 session >> object >> in the memory all the time. It doesn't seem that the connection from >> PooledConnectionFactory is being re-used, otherwise, the chances are >> multiple session objects per connection should exist. >> >> Here is a snippet of code from PooledConnectionFactory. I only see where >> it >> adds new connection to the pool. But I don't see where it get the >> connection >> from the pool other than when removing connection when >> pools.size()==maxConnections. Please correct me if I am not understanding >> PooledConnectionFactory. >> >> public synchronized Connection createConnection(String userName, >> String >> password) throws JMSException { >> ConnectionKey key = new ConnectionKey(userName, password); >> LinkedList pools = cache.get(key); >> >> if (pools == null) { >> pools = new LinkedList(); >> cache.put(key, pools); >> } >> >> ConnectionPool connection = null; >> if (pools.size() == maxConnections) { >> connection = pools.removeFirst(); >> } >> >> // Now.. we might get a connection, but it might be that we need >> to >> // dump it.. >> if (connection != null && connection.expiredCheck()) { >> connection = null; >> } >> >> if (connection == null) { >> ActiveMQConnection delegate = createConnection(key); >> connection = createConnectionPool(delegate); >> } >> pools.add(connection); >> return new PooledConnection(connection); >> } >> -- >> View this message in context: >> http://www.nabble.com/Sending-message-using-JmsTemplate-with-PooledConnectionFactory-hangs-periodically-tp19734135p19734135.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Sending-message-using-JmsTemplate-with-PooledConnectionFactory-hangs-periodically-tp19734135p19745537.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.