activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oseymen <>
Subject Camel - PooledConnectionFactory or not
Date Mon, 12 Sep 2011 10:50:22 GMT
Hi all,
I am trying to understand the most optimised way to send messages
concurrently between two activemq endpoints using Camel. There has been some
discussions on this in the mail groups but some of them confuses me even
more. So I am looking the draw the line under this topic and get your
recommendations on how to configure them for efficient use.

ActiveMQ documentation ( - Using
connection pooling) recommends using PooledConnectionFactory together with
camel's ActiveMQComponent in order to pool connections, sessions and
producers. Camel in Action book recommends using camel ActiveMQComponent and
notes that it configures connection pooling automatically for improved
performance (page 198) and does not mention PooledConnectionFactory at all.
So should I assume that camel's ActiveMQComponent does not pool sessions and

Furthermore, considering the example in AMQ documentation page above:

<bean id="jmsConnectionFactory" 
   <property name="brokerURL" value="tcp://localhost:61616" />

<bean id="pooledConnectionFactory" 
   <property name="maxConnections" value="8" />
   <property name="maximumActive" value="500" />
   <property name="connectionFactory" ref="jmsConnectionFactory" />

<bean id="jmsConfig"
   <property name="connectionFactory" ref="pooledConnectionFactory"/>
   <property name="transacted" value="false"/>
   <property name="concurrentConsumers" value="10"/>

<bean id="B1" 
    <property name="configuration" ref="jmsConfig"/>

With a route configuration like this where messages are moved from B1
(configured above) and some other activemq instance B2:
	<from uri="B1:Q1" />
	<to uri="B2:Q1" />

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)? 
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

Based on your experiences, can you advice when to use
PooledConnectionFactory and any tradeoffs you are aware of please?

Apologies if this is too long a mail but I'd appreciate any info/advice you
can give.


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message