With Camel 2.23.1, I use the camel "dynamic to" (toD) with an SFTP URI to add dynamic properties such as host, username, etc. This URI includes the "tempFileName" property.
What I saw with this code example :
.toD("sftp://${exchangeProperty.username}@${exchangeProperty.host}:${exchangeProperty.port}/${exchangeProperty.folder}"
+ "?privateKeyFile=${exchangeProperty.privatekey}"
+ "&privateKeyPassphrase=${exchangeProperty.keypassphrase}"
+ "&password=${exchangeProperty.password}"
+ "&preferredAuthentications=publickey"
+ "&passiveMode=${exchangeProperty.mode}"
+ "&connectTimeout=${exchangeProperty.timeout_connect}"
+ "&soTimeout=${exchangeProperty.timeout_socket}"
+ "&timeout=${exchangeProperty.timeout_read}"
+ "&tempFileName=inprogress.${file:name}.filepart"
+ "&stepwise=${exchangeProperty.stepwise}"
+ "&fastExistsCheck=${exchangeProperty.fastExistsCheck}"
)
it creates one connection per file, which is not what I want to achieve.
But if I comment or remove the "tempFileName" part it takes only a limited pool of connection. It also work if I use a simple endpoint (to), with or without the "tempFileName" property.
I would like to keep a pool of connection for each dynamic endpoints (so without disconnect
) and a way to define a temporary filename when uploading. For the filename we generally use an header such as Exchange.FILE_NAME and/or Exchange.FILE_NAME_ONLY but I haven't seen it for temporary filename.
Can someone help me with that ?