camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Kettelerij <richardkettele...@gmail.com>
Subject Re: download files for each xml entry
Date Tue, 25 Mar 2014 07:58:02 GMT
Hi,

I don't think using a filter yields the desired outcome. With this filter
you're only verifying whether the XML file contains a "entry/filter" node.
If the XML file is valid this will always succeed but it will not help you
in downloading additional files.

I guess what you're looking for is the *splitter*. With the splitter you
can process each "entry/link" node separately. Read about it:
http://camel.apache.org/splitter.html. Also the splitter allows for easily
adding parallel processing latter on:
split(xpath("entry/link")).parallelProcessing()......

Regards,
Richard
http://richardlog.com


On Mon, Mar 24, 2014 at 2:21 PM, sb.append <a261427@drdrb.net> wrote:

> Hello,
>
> I've simple task to parse xml entries containing links to files. For each
> entry the file should be downloaded. Is the following route a correct
> approach?
>
>         from("direct:start")
>             .to("http://address.of.xml")
>             .filter()
>             .xpath("entry/link")
>             .to(body())
>             .to("file:input);
>
> I'd like to add parallel download later too.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/download-files-for-each-xml-entry-tp5749276.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message