Hi Jitesh, You can separate the polling of the two FTP into two separate routes:
//normal route from("ftp://[username@]hostname[:port]/output") //code for normal output .to("direct:process_extracted_file"); //error route from("ftp://[username@]hostname[:port]/error") //code for error output .to("direct:process_extracted_file"); They can be in the same routebuilder class. Raymond On Mon, Oct 24, 2022 at 12:18 PM Jitesh Adsul <jiteshadsul...@gmail.com> wrote: > Hello folks !!! > > I have requirement to poll two ftp folders say "output" and "error" for > file. Actual file could come in either of two folders(not both). I tried > multicast (even used completionSize of 1) but process keeps waiting as > camel waits for both output and error endpoint routes to complete. > > //sample code > > from("direct:got_filename_to_poll") > > .multicast() .parallelProcessing(true) .to("ftp:output", "ftp:error") > .end() > > .to("direct:process_extracted_file") > > Is there any way to interrupt "ftp:error" sub-route if I get response from > "ftp:output" sub-route(or vice versa) or is there any other option to solve > this problem without compromising response time, example adding timeout on > slow response will slow down overall response time. > > > > Thanks & Regards > > Jitesh >