I have a file on an SFTP server and my application reads this file line by line. From the point of view of the application, everything is fine. The file is processed and everything works as expected. But there is one oddity. My application is continuously (one message per minutes) printing this message in the log:
2021-07-09 09:18:10.387 WARN 1 --- [com:22/out/Test] o.a.c.c.file.remote.SftpOperations : JSCH -> Permanently added 'my.host.com' (RSA) to the list of known hosts.
I am using version
This is how the connection address looks like:
I see a similar resolved issue on Jira. Do we have a chance that this issue wasn’t resolved or this fix didn’t get on these dependencies?
By default, the Camel SFTP component sets parameter
no (always insert the new host key). JSch logs that warning when it inserts a new host key. Because you set parameter
useUserKnownHostsFile=false and did not specify a known hosts file, JSch does not persistently remember the new host key, so it always inserts the host key and logs that warning on subsequent connections.
I work around this issue by configuring the logger to suppress that warning:
logging.level: org.apache.camel.component.file.remote: ERROR