Hi,
Thanks for the pointer! I have changed to use PooledConnectionFactory as
you suggest and it seems to work well now.
Here is my config: does it look sensible?
<bean id="activemq" class="org.apache.activemq.
camel.component.ActiveMQComponent">
<property name="transacted" value="true"/>
<property name="configuration" ref="myConfigDelivery"/>
</bean>
<bean id="myConfigDelivery"
class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory"
ref="jmsConnectionFactoryDelivery"/>
<property name="transactionManager"
ref="jmsTransactionManagerDelivery"/>
<property name="concurrentConsumers" value="1"/>
<property name="maxConcurrentConsumers" value="1"/>
<property name="transacted" value="true"/>
</bean>
<bean id="jmsTransactionManagerDelivery"
class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory"
ref="jmsConnectionFactoryDelivery"/>
</bean>
<bean id="activeMqConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${broker.url}"/>
<property name="redeliveryPolicy" ref="redeliveryPolicyDelivery"/>
</bean>
<bean id="jmsConnectionFactoryDelivery" class="org.apache.activemq.pool.
PooledConnectionFactory">
<property name="connectionFactory" ref="activeMqConnectionFactory"/>
</bean>
<bean id="redeliveryPolicyDelivery"
class="org.apache.activemq.RedeliveryPolicy">
<property name="maximumRedeliveries" value="1000000"/>
<property name="useExponentialBackOff" value="true"/>
<property name="backOffMultiplier" value="5"/>
</bean>
On Tue, Apr 5, 2011 at 10:47 AM, James Strachan <[email protected]>wrote:
> If you don't set any ConnectionFactory on the ActiveMQ component, you
> should have pooling setup correctly which should pool a single
> connection. e.g. just set the brokerURL property on the ActiveMQ
> component.
>
> Whats your spring XML look like?
>
> On 4 April 2011 16:54, Tom Howe <[email protected]> wrote:
> > I have a simple route that goes
> >
> > from("file:/some/path").to("activemq:some/queue");
> >
> > From truss and activeMq admin page, I notice that it is constantly
> > connecting/closing the connections.
> >
> > Is there a way to make the endpoint retain a connection to make it more
> > efficient?
> >
> > Thanks, Tom
> >
>
>
>
> --
> James
> -------
> FuseSource
> Email: [email protected]
> Web: http://fusesource.com
> Twitter: jstrachan, fusenews
> Blog: http://macstrac.blogspot.com/
>
> Connect at CamelOne May 24-26
> The Open Source Integration Conference
> http://camelone.com/
>