activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gradecak <dan...@gradecak.com>
Subject Re: Connection pooling
Date Tue, 24 Apr 2007 09:01:29 GMT
I wonder if if this configuration does the pooling correctly?

   <bean id="jmsResourceAdapter" 
class="org.apache.activemq.ra.ActiveMQResourceAdapter">
       <property 
name="serverUrl"><value>${jms.brokerUrl}</value></property>
     </bean>

   <bean id="transactionManager" 
class="org.jencks.factory.TransactionManagerFactoryBean">
       <property 
name="defaultTransactionTimeoutSeconds"><value>${jms.transaction.timeout}</value></property>


   </bean>
 
   <bean id="connectionFactory" 
class="org.jencks.amqpool.JcaPooledConnectionFactory">
       
<constructor-arg><value>${jms.brokerUrl}</value></constructor-arg>
  
       <property name="transactionManager" ref="transactionManager"/>
       <property 
name="maxConnections"><value>${jms.pool.maxConnections}</value></property>
   </bean>
     <bean id="jmsTemplate" 
class="org.springframework.jms.core.JmsTemplate">
       <property name="connectionFactory" ref="connectionFactory"/>
       <property 
name="receiveTimeout"><value>${jms.receive.timeout}</value></property>
   </bean>

Here (http://activemq.apache.org/how-do-i-use-jms-efficiently.html) it 
is suggested that "you can reuse the same MessageProducer for sending 
messages to different destinations" which seems ok.
But I wonder if JmsTemplate is doing that correctly with the 
org.jencks.amqpool.JcaPooledConnectionFactory? I thought that 
JmsTemplate was creating a new producer/receiver each time, please
tell me I am wrong. If so, could I somehow configure that with JmsTemplate?

Regards,
Daniel

James Strachan wrote:
> On 4/24/07, Peter Steil <petelocke@gmx.net> wrote:
>> Hi,
>>
>> I am using release 4.1.1 and I am wondering whether or not 
>> TopicConnections are pooled automatically somehow.
>
> No.
>
>> I have quite a lot TopicPublisher who publish to different topics. 
>> Should I keep one TopicConnection open and use it for all 
>> TopicSessions or should I open and close the connections each time?
>
> http://activemq.apache.org/how-do-i-use-jms-efficiently.html
>
> so typically use 1 connection and have a pool of consumers (maybe via
> MDBs or Jencks or Springs MessageListenerContainers) then use a pool
> of session/producers either through ActiveMQ's PooledConnectionFactory
> with Spring's JmsTemplate or just use one producer and synchronize on
> it
>
> http://cwiki.apache.org/ACTIVEMQ/how-do-i-send-messages-to-different-destinations-from-a-single-messageproducer.html

>
>
>

Mime
View raw message