Hi

Yes

The spring transaction manager and the Camel policy() stuff just ensures that 
it's the spring transaction manager that handles the redeliveries and not 
Camels non-transactional default DeadLetterChannel.

So whatever the configuration you have of ActiveMQ should kick in and retry the 
number of times you have specified and move it to ActiveMQ DLQ.

So it actually works. And I'm in doubt now that its regardless what type of 
exception you throw - Runtime or not. 


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: michaellear [mailto:[EMAIL PROTECTED] 
Sent: 11. juli 2008 13:27
To: [email protected]
Subject: RE: Transactions not rolling back


Hi Claus 
   
    Thanks for the quick reply I changed the exception to RuntimeException
but still seem to get the problem. Is it my lack of understanding of the
transactions in JMS. The message is retried the number of times it should
and a message is sent onto the ActiveMQ.DLQ when those retries have all
failed is this infact correct. 

Thanks

Mike





Claus Ibsen wrote:
> 
> Hi
> 
> ;) I do think I have had the same issue buts the answer is that it's the
> behavior of Spring transaction manager. It only rolls back on
> RuntimeExceptions. So if you change to
> 
> throw new RuntimeException("I must use runtime!!!");
> 
> It's the same concept as the EJB stuff where you had to extend some EJB
> exceptions to also rollback.
> 
> Could you verify it and then I do think I should add a "gotch" section to
> the transactional client wiki page.
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: michaellear [mailto:[EMAIL PROTECTED] 
> Sent: 11. juli 2008 12:57
> To: [email protected]
> Subject: Transactions not rolling back
> 
> 
> Hi 
> 
>    I know this issue has been covered a great deal through past posts. But
> I
> have read through them all and still keep getting the same problems. I've
> also tried using the different XML and Java DSL examples in the camel
> trunck. I'm using ActiveMQ 5.1 and the latest camel snapshot. I want to
> take
> a message from a queue send it to a producer and that producer throw and
> exception and that message get rolled back and be kept on the queue. As
> I've
> said I've tried using the Camel Transaction Client example and many others
> but each time my message is consumed and moved of the queue. Is there
> something I have to setup with ActiveMQ. Below is my current XML
> configuration although I've changed this many times using different
> examples
> and sugestions. Any help would be greatly appreciated I seem to be going
> around in circles. When I look at the debug messages it always seems to
> commit in the TransactionInterceptor and this includes the fix for patch
> 634.
> 
>     <bean id="myProcessor" class="MyProcessor"/>
> 
>       <camelContext id="camel"
>               xmlns="http://activemq.apache.org/camel/schema/spring";>
>         <route>
>             <from uri="jms:queue:TestTrans"/>
>             <policy ref="PROPAGATION_REQUIRED"/>
>                       <process ref="myProcessor"/>            
>         </route>
>       </camelContext>
>       
>     <bean id="jmsConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="tcp://localhost:61616"/>
>     </bean>
> 
>     <bean id="jmsTransactionManager"
> class="org.springframework.jms.connection.JmsTransactionManager">
>         <property name="connectionFactory" ref="jmsConnectionFactory"/>
>     </bean>
> 
>     <bean id="jmsConfig"
> class="org.apache.camel.component.jms.JmsConfiguration">
>         <property name="connectionFactory" ref="jmsConnectionFactory"/>
>         <property name="transactionManager" ref="jmsTransactionManager"/>
>         <property name="transacted" value="true"/>
>         <property name="concurrentConsumers" value="1"/>
>     </bean>
> 
>     <bean id="activemq"
> class="org.apache.camel.component.jms.JmsComponent">
>         <property name="configuration" ref="jmsConfig"/>
>     </bean>
> 
>     <bean id="PROPAGATION_REQUIRED"
> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>         <constructor-arg>
>             <bean
> class="org.springframework.transaction.support.TransactionTemplate">
>                 <property name="transactionManager"
> ref="jmsTransactionManager"/>
>             </bean>
>         </constructor-arg>
>     </bean>
> 
> 
> The MyProcessor class simply throws and exception
> 
> public class MyProcessor implements Processor {
> 
>       public void process(Exchange exchange) throws Exception {
>               throw new Exception("Forced Exception");
>       }
> }
> 
> -- 
> View this message in context:
> http://www.nabble.com/Transactions-not-rolling-back-tp18401259s22882p18401259.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Transactions-not-rolling-back-tp18401259s22882p18401759.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to