JiriOndrusek opened a new pull request, #3122:
URL: https://github.com/apache/camel-kamelets/pull/3122

   fixes https://github.com/apache/camel-kamelets/issues/3121
   
   `tika-extract-text-action` and `docling-convert-action` read a whole file or 
stream before checking `maxDocumentSize` (`apache/camel-kamelets#3121`). Now:
   
   - File: sized by the `CamelFileLength` header; a plain `java.io.File` or 
disk-spooled cache by its `long` length(). No read.
   - Uncached stream: at most `maxDocumentSize + 1` bytes are read, then it is 
closed. It is held in an exchange property, so exchanges with stream caching 
switched off still work.
   - Sizes compare as `long`: no wrap-around past 2 GiB.
   
   Tests: IT `CommonIT#langchain4jIngest` 11/11; root `clean install` OK; 
mutation checks fail as expected.
   
   Open nits:
   - `documentStream` property is left on the exchange if the read or close 
fails.
   - No test for the property removal.
   - A `WrappedFile` without `CamelFileLength` is still read in full (int 
count).
   - Error message wording: `(more than 40 bytes)`.
   
   _Generated with [Claude Code](https://claude.com/claude-code) on behalf of 
`JiriOndrusek`_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to