You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Denis S <ds...@yahoo.com> on 2012/11/07 06:24:19 UTC
How to process a file several times?
Hi,
I have the following Camel route:
<route id="processCSV">
<from
uri="file://../import?noop=true&charset=ISO-8859-1&sorter=#myDataProcessor&processStrategy=#myDataProcessor"/>
<log message="Processing big file: ${header.CamelFileName}"
loggingLevel="INFO"/>
<to uri="direct:csv"/>
<log message="Done processing big file: ${header.CamelFileName}"/>
</route>
So, the route take CSV files from import folder and submits them for
processing. I implemented custom fileProcessingStrategy and sorter. I need
to process one of the files twice. The way I found: I'm renaming it at
commit phase of the first processing. But I suspect rhere is more native way
to do this. May be to raise an exception at commit phase for redelivery?
Thanks, Denis.
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-process-a-file-several-times-tp5722272.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to process a file several times?
Posted by Christian Müller <ch...@gmail.com>.
Can you try combining a content based router and for this file, you use a
multicast instead of a to() and send the message twice to the same endpoint?
Another possibility is to use the routing slip.
Sent from a mobile device
Am 07.11.2012 06:32 schrieb "Denis S" <ds...@yahoo.com>:
> Hi,
>
> I have the following Camel route:
>
> <route id="processCSV">
> <from
>
> uri="file://../import?noop=true&charset=ISO-8859-1&sorter=#myDataProcessor&processStrategy=#myDataProcessor"/>
> <log message="Processing big file: ${header.CamelFileName}"
> loggingLevel="INFO"/>
> <to uri="direct:csv"/>
> <log message="Done processing big file: ${header.CamelFileName}"/>
> </route>
>
> So, the route take CSV files from import folder and submits them for
> processing. I implemented custom fileProcessingStrategy and sorter. I need
> to process one of the files twice. The way I found: I'm renaming it at
> commit phase of the first processing. But I suspect rhere is more native
> way
> to do this. May be to raise an exception at commit phase for redelivery?
>
>
> Thanks, Denis.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-process-a-file-several-times-tp5722272.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>