You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Seibt, Volker" <vo...@buenting.de> on 2013/10/21 14:27:02 UTC

Scheduled SFTP consumer

I am trying to achieve the following:
1. Schedule a sftp-consumer with quartz
2. retrieving all files from a remote subfolder via sftp
3. moving this files to .done
4. disconnecting

I tried this with camel 2.11.2 and a pollenrich, but did not get it running. Depending what I tried (streamDownload, localWorkDirectory, disconnect ...) I got several exceptions or errors.

In 2.12.1 ftp component has a scheduler attribute and after fixing the missing package in camel-quartz2 everything seems to work fine.
But switching to 2.12.1 requires updates of several libraries, especially quartz 2 and spring.

So I wonder if the scheduler attribute in 2.12.x is only for convenience or if it is the only way to achieve the desired behavior? Or, asked the other way, did anybody got this running with camel version lower than 2.11.x and pollenrich?

Kind regards,

Volker Seibt

Bünting Informations Technologie GmbH
Johann-Bünting-Straße 1, 26845 Nortmoor
Tel: 0491 808-129
Fax: 0491 808-345
------------------------------------------------------------------------------
Bünting Informations Technologie GmbH
Brunnenstraße 37, 26789 Leer
Geschäftsführer: Dr. Jörg Rösner
Sitz Leer, Ostfriesland - Amtsgericht Aurich HRB 111208
www.buenting.de
------------------------------------------------------------------------------



Re: Scheduled SFTP consumer

Posted by alexey-s <al...@mail.ru>.
Maybe my example will help.
I use RoutePolicy.

CronScheduledRoutePolicy ftpDocReadRoutePolicy = new
CronScheduledRoutePolicy();
ftpDocReadRoutePolicy.setRouteStartTime(routePolicyStartTime);
ftpDocReadRoutePolicy.setRouteStopTime(routePolicyStopTime);
ftpDocReadRoutePolicy.setRouteStopGracePeriod(routePolicyStopGracePeriod);
		
from("{{ftp.doc.url}}" +
	"?noop=true" +
	"&binary=true" +
	"&passiveMode=true" +
	"&recursive=true" +
	"&stepwise=false" +
	"&disconnect=true" +
	"&delay=600000" +
	"&localWorkDirectory={{exchange.localStore}}" +
	"&idempotent=true" +
	"{{ftp.add_params}}")
.id("exchangeDocReadRoute")
.autoStartup(false)
.routePolicy(ftpDocReadRoutePolicy)
	.shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks)
.to("file:{{exchange.store}}");




--
View this message in context: http://camel.465427.n5.nabble.com/Scheduled-SFTP-consumer-tp5741976p5741979.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Scheduled SFTP consumer

Posted by Claus Ibsen <cl...@gmail.com>.
For Camel 2.11 and below you can use route policy
http://camel.apache.org/routepolicy

There is a quartz based route policy you can use.



On Mon, Oct 21, 2013 at 2:27 PM, Seibt, Volker <vo...@buenting.de> wrote:
> I am trying to achieve the following:
> 1. Schedule a sftp-consumer with quartz
> 2. retrieving all files from a remote subfolder via sftp
> 3. moving this files to .done
> 4. disconnecting
>
> I tried this with camel 2.11.2 and a pollenrich, but did not get it running. Depending what I tried (streamDownload, localWorkDirectory, disconnect ...) I got several exceptions or errors.
>
> In 2.12.1 ftp component has a scheduler attribute and after fixing the missing package in camel-quartz2 everything seems to work fine.
> But switching to 2.12.1 requires updates of several libraries, especially quartz 2 and spring.
>
> So I wonder if the scheduler attribute in 2.12.x is only for convenience or if it is the only way to achieve the desired behavior? Or, asked the other way, did anybody got this running with camel version lower than 2.11.x and pollenrich?
>
> Kind regards,
>
> Volker Seibt
>
> Bünting Informations Technologie GmbH
> Johann-Bünting-Straße 1, 26845 Nortmoor
> Tel: 0491 808-129
> Fax: 0491 808-345
> ------------------------------------------------------------------------------
> Bünting Informations Technologie GmbH
> Brunnenstraße 37, 26789 Leer
> Geschäftsführer: Dr. Jörg Rösner
> Sitz Leer, Ostfriesland - Amtsgericht Aurich HRB 111208
> www.buenting.de
> ------------------------------------------------------------------------------
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen