camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Céline Bugaud <c.bug...@gmail.com>
Subject Re: Problem with JMS transaction
Date Mon, 09 May 2011 13:48:03 GMT
Hello Ashwin,

Thank you for the quick reply !

The only major difference I see between our configurations is that you
create two differents ActiveMQComponent, one per queue. In my
configurations the two queues are using the same ActiveMQComponent,
configured with the transactionManager.

Is that what I'm doing wrong ? Can't I have two queues using the same
activeMQComponent ?

In your exemple, the second ActiveMQComponent is not using any
transactionManager, will he be used then inside the transactionManager
of the first one ?

Thanks again for your help, I'm quite new at this...

Regards,

-- 
Céline

On Mon, May 9, 2011 at 2:00 PM, Ashwin Karpe <akarpe@fusesource.com> wrote:
> Hi,
>
> Looks like you have not wired your  amqTransactionManager correctly to your
> connectionFactory and hence the transaction is not properly wired to the JMS
> endpoint.
>
> Please check the example below.
>
> Cheers,
>
> Ashwin...
>
> ----------------------------------------------------
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:camel="http://camel.apache.org/schema/spring"
>       xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>         http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
>
>     <camelContext>
>            <route>
>                   <from ref="activemq:queue:foo" />
>                   <transacted ref="required"/>
>                   <to ref="activemq:topic:bar" />
>            </route>
>     </camelContext>
>
>    <bean id="jmsConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>        <property name="brokerURL"
> value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
>    </bean>
>
>    <bean id="jmsTransactionManager"
> class="org.springframework.jms.connection.JmsTransactionManager">
>        <property name="connectionFactory" ref="jmsConnectionFactory"/>
>    </bean>
>
>    <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>        <property name="connectionFactory" ref="jmsConnectionFactory"/>
>        <property name="transacted" value="true"/>
>        <property name="transactionManager" ref="jmsTransactionManager"/>
>    </bean>
>
>    <bean id="activemq2"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>        <property name="brokerURL"
> value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
>    </bean>
>
>   <bean id="required"
> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>         <property name="transactionManager" ref="amqTransactionManager" />
>         <property name="propagationBehaviorName"
> value="PROPAGATION_MANDATORY" />
>   </bean>
>
> </beans>
>
> -----
> ---------------------------------------------------------
> Ashwin Karpe
> Apache Camel Committer & Sr Principal Consultant
> FUSESource (a Progress Software Corporation subsidiary)
> http://fusesource.com
>
> Blog: http://opensourceknowledge.blogspot.com
> CamelOne 2011: http://fusesource.com/camel2011
> ---------------------------------------------------------
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-with-JMS-transaction-tp4381332p4381695.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
View raw message