camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "valerian.merkling" <valerian.merkl...@capgemini.com>
Subject TransactionnalDeadLetterChannel ?
Date Thu, 07 Mar 2013 10:10:19 GMT
Hi, 

My route read a file, parse the xml stuff inside, valid and transform it to
finally write it somewhere else.

My goal is : on any unhandled error, rollback and redeliver up to X times,
every Y seconds and finally send the original file on another queue.

Right now, i've defined a deadLetterChannel, which does almost all the job,
except the message sent on the dead end queue is not the original file, but
the one just before the unhandled error.

I guess I've to deal with some transactionnal stuff, i've seen some example
about transaction on JMS endpoint, but nothings on file so i'm not sure
about the right way to follow...

Here is the code :

    <bean name="transform-xxx-yyy"
class="TEST.esb.transform.XXXtoYYYTransform" />
    <bean id="myDeadLetterErrorHandler"
class="org.apache.camel.builder.DeadLetterChannelBuilder">
        <property name="deadLetterUri" value="activemq:queue:toretry"/>
        <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig"/>
    </bean>
    <bean id="myRedeliveryPolicyConfig"
class="org.apache.camel.processor.RedeliveryPolicy">
        <property name="maximumRedeliveries" value="6"/>
        <property name="redeliveryDelay" value="10000"/>
    </bean>

    <camelContext id="central-cr-colisage"
xmlns="http://camel.apache.org/schema/spring" >
        <propertyPlaceholder id="properties"
location="file:D:/TEST/esb.properties" />
        <route id="xxx-to-yyy">
            <from uri="file://{{esb.colisage.root}}in//?delete=true" />
                <convertBodyTo type="java.lang.String"/>
                <to uri="validator:file:D://TEST//xsd//XXX.xsd"/>
                <to uri="file://{{esb.colisage.root}}save//" />
                <to uri="transform-xxx-yyy"/>
                <to uri="validator:file:D://TEST//xsd//YYY.xsd"/>
                <to uri="file://F:/{{esb.colisage.output.folder}}" />
        </route>
		<route id="error-to-retry-route">
            <from uri="activemq:queue:toretry"/>
            <log message="Parking ${in.headers.camelFileName}"
loggingLevel="ERROR"/>
            <to uri="file://{{esb.colisage.root}}retry//" />
        </route>
	</camelContext>


I don't know if i have to use the TransactionnalClient or if there's a way
to give a transactionnal aspect to the deadLetterChannel. Any help is
welcome !

Regards, 

Valerian



--
View this message in context: http://camel.465427.n5.nabble.com/TransactionnalDeadLetterChannel-tp5728729.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message