On 4/24/07, Daniel Gradecak <[EMAIL PROTECTED]> wrote:
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>


Looks fine to me.


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.

BTW thats really intended for folks who are using the JMS API directly
rather than JmsTemplate


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

it does

, please
tell me I am wrong. If so, could I somehow configure that with JmsTemplate?

No you can't. JmsTemplate creates/closes all the JMS resources each
time so you're only hope is to use only sending along with
PooledConnectionFactory, or Jencks


--
James
-------
http://macstrac.blogspot.com/

Reply via email to