You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rwijngaa <ri...@gmail.com> on 2016/01/29 09:29:14 UTC

Content-Length and CamelFileLength suddenly 0

Hi,

When downloading a file with (camel:) ftp or http, i suddenly see that
Content-Length / CamelFileLength = 0 despite the fact that the InputStream
that *is* available in the body is not empty (i.e. containt 300+ bytes)

Any idea as to when this could happen?

I'm using Camel 2.15.1
Regards
Rino



--
View this message in context: http://camel.465427.n5.nabble.com/Content-Length-and-CamelFileLength-suddenly-0-tp5776967.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Content-Length and CamelFileLength suddenly 0

Posted by rwijngaa <ri...@gmail.com>.
Note, the FtpChangedRenameReadLockStrategy combines the 'changed' and the
'rename' read lock strategy. It first calls acquire on
GenericFileRenameExclusiveReadLockStrategy, followed by a acquire call on
FtpChangedExclusiveReadLockStrategy.

This is because the @#$%^&* SAP system first creates an empty file, and
-while holding on to the file- fills it with data.



--
View this message in context: http://camel.465427.n5.nabble.com/Content-Length-and-CamelFileLength-suddenly-0-tp5776967p5777141.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Content-Length and CamelFileLength suddenly 0

Posted by rwijngaa <ri...@gmail.com>.
Example:


Body class: class org.apache.camel.component.file.remote.RemoteFile
Endpoint
key=ftp://xxxxxxx/Acceptance/SAP/I0019/Outbox?antFilterCaseSensitive=false&antInclude=NID*&binary=true&delay=30000&delete=true&disconnect=true&exclusiveReadLockStrategy=%23ftpChangedRenameReadLockStrategy&maxMessagesPerPoll=100&passiveMode=true&password=secret&readLock=rename&readLockCheckInterval=5000&readLockTimeout=30000&stepwise=false&username=userxyz
Endpoint
uri=ftp://xxxxxxx/Acceptance/SAP/I0019/Outbox?antFilterCaseSensitive=false&antInclude=NID*&binary=true&delay=30000&delete=true&disconnect=true&exclusiveReadLockStrategy=%23ftpChangedRenameReadLockStrategy&maxMessagesPerPoll=100&passiveMode=true&password=secret&readLock=rename&readLockCheckInterval=5000&readLockTimeout=30000&stepwise=false&username=userxyz
in header breadcrumbId =
FM-4.4.16:05:09.948-ID-xxxxxxx-53193-1453969305680-1-3177
in header CamelFileAbsolute = false
in header CamelFileAbsolutePath = Acceptance/SAP/I0019/Outbox/NID2795
in header CamelFileHost = xxxxxxx
in header CamelFileLastModified = 1453993380000
in header CamelFileLength = 0
in header CamelFileName = NID2795
in header CamelFileNameConsumed = NID2795
in header CamelFileNameOnly = NID2795
in header CamelFileParent = Acceptance/SAP/I0019/Outbox
in header CamelFilePath = Acceptance/SAP/I0019/Outbox/NID2795
in header CamelFileRelativePath = NID2795
in header CamelFtpReplyCode = 226
in header CamelFtpReplyString = 226 Transfer complete.^M



Note CamelFileLength=0 but the file was *not* empty!



--
View this message in context: http://camel.465427.n5.nabble.com/Content-Length-and-CamelFileLength-suddenly-0-tp5776967p5777139.html
Sent from the Camel - Users mailing list archive at Nabble.com.