You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Premkumar <pr...@cognizant.com> on 2016/03/16 10:29:19 UTC

Camel Synchronous One time Routing for files

I am trying to setup Synchronous dynamic one time only routes (File to FTP,
FTP to File, File to SFTP, file to FTPS). I understand we can do synchronous
routing using Producer Template and Consumer Template. But problem i am
facing with Producer/Consumer template error handling. 

Consumer template is successful from FTP site (with delete=true) Option and
Producer trying to write file into filesystem fails. File is lost for ever.

Also if we need additional processing or filtering or predicate how can we
do it using using producer/consumer template and how the overall route
integrity is maintained. 



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Synchronous-One-time-Routing-for-files-tp5779150.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Synchronous One time Routing for files

Posted by Premkumar <pr...@cognizant.com>.
Thanks Quinn, for your valuable ideas. I have to explore the options
"RouteBuilder as Template" and "Camel SCR". I am a newbee for camel, i have
used camel hardly for 2 months, still learning camel components. 

Regarding your question on retries. Its the polling for FTP.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Synchronous-One-time-Routing-for-files-tp5779150p5779407.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Synchronous One time Routing for files

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
I’ve done “reusable routes” two ways so far.  

I found the first one in the book "Apache Camel Developer’s Cookbook” - it talks about using Java RouteBuilders as templates for routes and then using Spring to configure the actual instances.  I use Blueprint, but the same basic idea.

The second one is using camel-scr - after creating the component, you setup another PID and you have a new instance of the route.

Neither of these solutions removes the route after is processes though - you’d have to work through that part.

I still don’t quite understand what you’re after with “synchronous”.  Basing a service call on the result of FTP download is pretty straightforward, and I’m not sure if the “retry option” you’re talking about is for the FTP polling or for the service call.  When you say “synchronous”, do you only want one FTP download going on at a time?  Or do you just need resulting actions to be based on the result of the file retrieval?


> On Mar 17, 2016, at 3:05 PM, Premkumar <pr...@cognizant.com> wrote:
> 
> 
> There are common patterns in route. for example: Picking up from FTP
> location, there will be n different ftp sites with different credentials and
> pickup directory. How can we make it as reusable routes.
> 
> The reason for going for synchronous route, reason is i need to make some
> RESTful service call based on the outcome of the success/failure of route.
> another reason handling retries if there are connectivity to FTP/SFTP sites.
> Each client provides us different retry option (no of retries and retry
> interval to connect to their sites. 
> 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Synchronous-One-time-Routing-for-files-tp5779150p5779252.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Synchronous One time Routing for files

Posted by Premkumar <pr...@cognizant.com>.
There are common patterns in route. for example: Picking up from FTP
location, there will be n different ftp sites with different credentials and
pickup directory. How can we make it as reusable routes.

The reason for going for synchronous route, reason is i need to make some
RESTful service call based on the outcome of the success/failure of route.
another reason handling retries if there are connectivity to FTP/SFTP sites.
Each client provides us different retry option (no of retries and retry
interval to connect to their sites. 




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Synchronous-One-time-Routing-for-files-tp5779150p5779252.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Synchronous One time Routing for files

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Sorry - I didn’t ask my question very well.

How different are the “dynamic routes”?  Are there a few common patterns, and you’re just applying different configurations to those patterns?

Also, why do you think you’d have better control and error handling if you run the routes synchronously?

If you could provide some more detail on the type(s) of routes you’re trying to dynamically create, how you envision triggering the creation of the routes (i.e. a file, a JMS messages, whatever), and what kind of “control and error handling” you think you may loose with parallel operation of the routes, that would help.

> On Mar 16, 2016, at 8:10 PM, Premkumar <pr...@cognizant.com> wrote:
> 
> Yes Quinn, Routes are added on the fly.  We have pickup on schedules (Using
> Quartz Jobs)  and delivery of file (immediate delivery and with schedules)
> and there are some routes which are polling at local Filesystem and
> delivering internal FTP sites.
> 
> since we are dealing with file system and we thought we would have better
> control + error handling when executing routes synchronously and also most
> routes one time only. 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Synchronous-One-time-Routing-for-files-tp5779150p5779176.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Synchronous One time Routing for files

Posted by Premkumar <pr...@cognizant.com>.
Yes Quinn, Routes are added on the fly.  We have pickup on schedules (Using
Quartz Jobs)  and delivery of file (immediate delivery and with schedules)
and there are some routes which are polling at local Filesystem and
delivering internal FTP sites.

since we are dealing with file system and we thought we would have better
control + error handling when executing routes synchronously and also most
routes one time only. 



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Synchronous-One-time-Routing-for-files-tp5779150p5779176.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Synchronous One time Routing for files

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
What exactly do you mean by “synchronous dynamic one time only routes”?

Are you trying to add/remove routes on the fly?  Are you trying to pickup/deliver specific files using a trigger rather than a polling system?


> On Mar 16, 2016, at 3:29 AM, Premkumar <pr...@cognizant.com> wrote:
> 
> I am trying to setup Synchronous dynamic one time only routes (File to FTP,
> FTP to File, File to SFTP, file to FTPS). I understand we can do synchronous
> routing using Producer Template and Consumer Template. But problem i am
> facing with Producer/Consumer template error handling. 
> 
> Consumer template is successful from FTP site (with delete=true) Option and
> Producer trying to write file into filesystem fails. File is lost for ever.
> 
> Also if we need additional processing or filtering or predicate how can we
> do it using using producer/consumer template and how the overall route
> integrity is maintained. 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Synchronous-One-time-Routing-for-files-tp5779150.html
> Sent from the Camel - Users mailing list archive at Nabble.com.