camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clemens <>
Subject PollEnrich from FTP with include=regex
Date Mon, 30 Jan 2012 08:48:38 GMT
Hi all, 

I am implementing/developing a route that needs to load files from
remote sites. 
In the first step I have a <choice > on the body to check which endpoint
and regex has to be used to load the files.  e.g.

<choice id="type">
    <simple>${body} range '0..9'</simple>
    <to uri="direct:loadSvgFiles"/>
    <simple>${body} range '20..29'</simple>
    <to uri="direct:loadXmlFiles"/>

In the next step I have to load a couple of files from the endpoint. As
there may be quite a lot of svg/xml files and I only need one type each
time the route is run, I start only the route, that gets the file with

And that is where i am stuck (ftpUrl is my ftp endpoint string with
&include=&include=.*svg$" to include all svg files)

If I use 

All Files are loaded and aggregated, but that happens every time the
route is started. 

  .pollEnrich(ftpUrl, timeout=1000l)

I get files, until timeout is reached. Setting timeout to -1, the route
loads all files but failes to stop, if the ftp server is unreachable.

What i need is kind of a merge of pollEnrich and aggregate. e.g. load
the first file with a timeout and then aggregate all files that are
mached by the regex. 
Or pollEnrich that failes after n connection errors in a row and loads
all files.

Any help would be great


View raw message