You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Nafees <s....@gmail.com> on 2012/07/25 12:54:50 UTC

FTP connect issue

Hi All,

I have a Route which gets files from FTP and copies to local folder, and
another route which picks up files and do some processing and the routes
stops when files count reaches ftpserver file count and route will be
removed from camelcontext.

All necessary information will be coming from an Object from ActiveMq and
based on info we create new routes everytime and control them appropriately.

Problem, I am facing is, First time I am running, it shows the no of files
correctly, next time , I run the same route , it shows one file less.

My FTP URL :
{0}://{1}@{2}/{3}?password={4}&binary={5}&passiveMode=true&pollStrategy=#optimerPoll&throwExceptionOnConnectFailed=true&maximumReconnectAttempts=0&localWorkDirectory=/tmp&idempotent=true&disconnect=true"

My FILE URL : {0}://{1}?noop=true&autoCreate=false

Routes are :

from (ftpUrl).to(fileUrl).bean(endRoute,"stopFtpRoute");

from(fileUrl).to(mediationProcessor).bean(endRoute,"stopLocalRoute");

in stopXXX(Exchange exhange){

String strRouteID = exchange.getFromRouteId();
....
 camelContext.stopRoute(strRouteID, 1000, TimeUnit.MILLISECONDS);
camelContext.getInflightRepository().removeRoute(strRouteID);
camelContext.removeRoute(strRouteID);

}

I am using disconnect = true in FTP options. Why is it showing me one file
less.

Plz help me.

Thanks
Nafees





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

Re: FTP connect issue

Posted by Nafees <s....@gmail.com>.
Hi

I have found one solution for this. Last file it was keeping in memory, so
everytime , I run the same route, it was giving one file less. 

I configured an explicit Memory based Idempotent repository in xml file 
<bean id="memoryRepo"
class="org.apache.camel.processor.idempotent.MemoryIdempotentRepository" />

When my whole processing is completed, after i stop and remove the related
routes,  I am calling 

memoryRepo.getCache().clear();

So, that next time, we run the same route, it will pick all the files
correctly.

Plz correct me if there is any better way to do this.

Regards
Nafees



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