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.