Search code examples
javaamazon-web-servicesapache-camelsftpedi

Having problem to connect on sftp after moving sftp to AWS through camel


I'm having problems to connect on the sftp through springboot camel app. This started happening after we moved our sftp to AWS . Now, I have a temporary server host which looks like this s-add03ac9b.server.transfer.eu-west-1.amazonaws.com, I can connect in there by using for instance FileZilla but if I try to connect using the app, this is the error I get:

Caused by: org.apache.camel.NoSuchEndpointException: No endpoint could be found for: s-add03ac9b.server.transfer.eu-west-1.amazonaws.com/testFolder?username=myUser&password=myPassword&disconnect=true&maxMessagesPerPoll=50&initialDelay=1s&delay=1s&timeout=3000&move=done&moveFailed=failed, please check your classpath contains the needed Camel component jar.

, and here is the route itself, I changed it a bit to be more readable

        from("s-add03ac9b.server.transfer.eu-west-1.amazonaws.com/testFolder?username=myUser&password=myPassword&disconnect=true&maxMessagesPerPoll=50&initialDelay=1s&delay=1s&timeout=3000&move=done&moveFailed=failed")
            .setHeader(Headers.CONFIGURATION.name(), constant(routeConfiguration))
            .setHeader("filenameModify").constant(modifyFileNames).setHeader("fileExtension")
            .constant(fileExtension).choice().when(PredicateBuilder.and(header("filenameModify").isEqualTo(true), header("fileExtension").isNotNull()))
            .setHeader(Exchange.FILE_NAME,
                    simple("${file:name.noext}-${date:in.header.CamelFileLastModified:ddMMyyyy-HHmmss}-${file:length}.${in.header.fileExtension}"))
            .end().idempotentConsumer(simple("${file:name}-${file:length}"), MemoryIdempotentRepository.memoryIdempotentRepository(1000))
            .log("Processing ${file:name}")
            .process(rawDataProcessor)
            .to((String) routeConfiguration.get(ConfigKey.END)).otherwise().log("File ${file:name} processed.").stop().end();

Do I need to add something else, maybe some dependency or...?


Solution

  • If anyone is having the same issue, I fixed it by adding an sftp:// as a prefix in from part.