activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Whaley <jasonwha...@gmail.com>
Subject Re: Camel - PooledConnectionFactory or not
Date Mon, 12 Sep 2011 11:44:01 GMT
> 
> 
> My questions are:
> 1. Where can I control the number of producers pooled in
> PooledConnectionFactory? Does it create and pool one producer per session
> (maximumActive setting above)? 

You can't really enforce the maximum number producers you actually have created, since a session
can potentially have numerous producer objects.  You can only really enforce the maximum number
of sessions, which you've set in "maximumActive".  Under your current configuration you are
potentially allowing yourself to have up to 4000 sessions.


> 
> 2. So if PooledConnectionFactory doesn't pool consumers, isn't it always
> inefficient to use PooledConnectionFactory for B1 and efficient for B2?  Or
> is it always more efficient to configure both endpoints (B1 and B2) with
> PooledConnectionFactory?


It's typically better to have a single connection for consumers since those are expected to
be long lived connections and you avoid the overhead of having several connections exist for
the purpose of pooling.  The JMS and ActiveMQ Camel components use Spring's JmsTemplate under
the hood - see http://activemq.apache.org/jmstemplate-gotchas.html .  That page recommends
using Spring's CachingConnectionFactory for consumers since that doesn't cache a connection
pool but caches session objects instead.



Mime
View raw message