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.

Reply via email to