0

I am working on a simple application based on camel. It reads some files from sftp location and then puts it to aws-s3 location. The problem is that after files are put in s3, I call the stop method of camel context. But the code get stuck there after printing "shutting down output of mydatabucket.s3.amazonaws.com/51.321.68.342:453 com.amazonaws.internal.SdkSSLSocket", on console and nothing happens further. This is very unexpected because later I will have to process files in s3 that are put by camel. But if camel context won't stop when there are no more files to pick from sftp then it wouldn't be possible. So how stop method of camel context works, because in my case it is obviously not working or lets say taking forever.

My routebuilder code is as below

 from(this.feedSource).routeId(this.routeId).setProperty("feedName", simple(this.feedName))
            .setProperty("options", simple(this.options))
            .setProperty("prefixKey", simple(this.prefixKey))
            .setProperty("dateFormat", simple(this.dateFormat))
            .setProperty("verifyFileSize", simple("true"))

            .filter().method(new FileFilter(), "process")
            .split(beanExpression(new FileProcessorFactory(), "getProcessor")).parallelProcessing()
            .filter().method(new FeedRouteFileFilter(), "isFileAlreadyProcessed")
            .id(simple(this.feedName) 
            .to(this.feedDestination).id(simple(this.feedName)
            .stop();

I start camel's main context by executing main.run() from a different file which actually starts the route.

Ananth
  • 787
  • 5
  • 18
  • Can you try stopping that route from another route? e.g. https://camel.apache.org/how-can-i-stop-a-route-from-a-route.html – Andy Longwill Feb 27 '17 at 10:57
  • Not sure I understand, do you want to stop the route or stop the entire CamelContext application that is running? If the latter, then why? – Souciance Eqdam Rashti Feb 27 '17 at 12:25
  • I am actually working on a data pipeline creation where camel is part of pipeline. I am extracting data from sftp to s3 using camel. Then process s3 data and load to redshfit. sftptos3 --> s3processing --> redshift. So as long as sftptos3 i.e., cameltask context wont finish I am not updating the status based on which next task starts. So basically my pipeline is not going beyond step 1. – Ananth Feb 27 '17 at 17:56
  • Possible duplicate of [How can I shutdown a standalone Apache Camel application in an automated way?](http://stackoverflow.com/questions/17311379/how-can-i-shutdown-a-standalone-apache-camel-application-in-an-automated-way) – Alessandro Da Rugna Mar 08 '17 at 09:24

0 Answers0