saravanakumar1987 opened a new pull request, #31408:
URL: https://github.com/apache/camel/pull/31408

   # Description
   
   Fixes [CAMEL-28126](https://issues.apache.org/jira/browse/CAMEL-28126).
   
   ## Summary
   
   The consumer got the objects of a poll before it routed the first exchange. 
It now gets each object right before it routes its exchange, as 
`AWS2S3Consumer` does since CAMEL-26662. So only the objects of the exchanges 
in flight are in memory with `includeBody=true`, or open as streams with 
`includeBody=false`.
   
   - The gets move from `OSSConsumer.poll` into `processBatch`, which gets each 
object that it routes.
   - A consumer that stops during a poll gets no further object of that poll, 
unless `shutdownRunningTask` is `CompleteAllTasks`.
   - A failed get reaches the exception handler after the consumer routed the 
other exchanges of the poll.
   - When the poll gets no object and a get failed, the poll still fails with 
the first failure.
   - The upgrade guide has a section on it.
   
   ### Why the batch properties and the queue use the listed objects
   
   The consumer sets the batch properties of an exchange before it gets the 
later objects of the poll. So they count the objects that the poll took, as in 
`AWS2S3Consumer`. The queue of `processBatch` holds these listed objects, as 
the queue of `AWS2S3Consumer` holds the listed `S3Object` items. The signature 
stays.
   
   ## Tests
   
   - `OSSConsumerGetEachObjectTest` has four tests: the order of the gets, the 
open streams, the batch properties and a failed get.
   - One test of `OSSConsumerIncludeBodyTest` now expects a stopping consumer 
to get only the object that it routes.
   - These five tests failed before the change, and the module build ran 45 
tests, none of them skipped or failed.
   - The catalog build ran 156 tests of `CamelCatalogTest`, none of them 
skipped or failed.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I ran `mvn clean install -Dquickly -DskipTests` on 0a914a2c0bd2, 
eleven commits before the parent, and resumed from camel-kserve with 
`-Dgrpc-version=1.85.1`. Then I ran `mvn install -nsu` in camel-alibaba-oss and 
`mvn install -nsu -Dtest=CamelCatalogTest` in catalog/camel-catalog, and 
committed all generated changes.
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   _Claude Code on behalf of saravanakumar1987_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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