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 (http://camel.apache.org/activemq.html - 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
producers?

Furthermore, considering the example in AMQ documentation page above:

<bean id="jmsConnectionFactory" 
   class="org.apache.activemq.ActiveMQConnectionFactory">
   <property name="brokerURL" value="tcp://localhost:61616" />
</bean>

<bean id="pooledConnectionFactory" 
   class="org.apache.activemq.pool.PooledConnectionFactory">
   <property name="maxConnections" value="8" />
   <property name="maximumActive" value="500" />
   <property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>

<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
   <property name="connectionFactory" ref="pooledConnectionFactory"/>
   <property name="transacted" value="false"/>
   <property name="concurrentConsumers" value="10"/>
</bean>

<bean id="B1" 
    class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="configuration" ref="jmsConfig"/>
</bean>

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

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

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.

Regards,
Ozan

--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Camel-PooledConnectionFactory-or-not-tp3807064p3807064.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to