Requirement is to not to download 1 GB File into memory but to download file as stream of XML.
private String sftpComponent(String sftpFileName) {
return "sftp://xxx/xxx"
+ "?username=xxx"
+ "&password=xxx"
+ "&streamDownload=true"
+ "&useList=true"
+ "&stepwise=false"
+ "&disconnect=true"
+ "&passiveMode=true"
+ "&reconnectDelay=10000"
+ "&bridgeErrorHandler=true"
+ "&delay=30000"
+ "&include="+ sftpFileName
+ "&preMove=$simple{file:onlyname}.$simple{date:now:yyyy-MM-dd'T'hh-mm-ss}.underproc"
+ "&move=$simple{file:onlyname.noext}.$simple{date:now:yyyy-MM-dd'T'hh-mm-ss}.done"
+ "&moveFailed=$simple{file:onlyname.noext}.$simple{date:now:yyyy-MM-dd'T'hh-mm-ss}.error"
+ "&readLock=idempotent-changed"
+ "&idempotentRepository=#infinispanCache"
+ "&readLockRemoveOnCommit=true";
}
from(sftpComponent(sftpFileName))
.split(body().tokenizeXML("case", "cases"))
.streaming()
.inOnly("jms/caseQueue")
<cases>
<case>
</case>
<case>
</case>
</cases>
The file is successfully picked and marked as success but flow does not split the content and move it to caseQueue.
When i use "download=true" then it works like charm.
Can anyone suggest what more settings are required in this case or alternative approach to fix above?