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

   [CAMEL-27423](https://issues.apache.org/jira/browse/CAMEL-27423)
   
   ## Problem
   
   `BodyFacts.describe` (CAMEL-25749) says what the message body is and which 
step set it, from the message history. For an item of a split it says that the 
consumer gave the body.
   
   In the local-model benchmark (connect-sftp-transfer step 2), the route 
unmarshals a CSV file and splits the rows, and an `onException` stores a row 
that failed. The store error of CAMEL-27151 said:
   
   ```
   Cannot store file: failed/invoices-2026-11-01.csv: No body available of 
type: java.io.InputStream but has type: java.util.LinkedHashMap on: 
invoices-2026-11-01.csv (the body is a Map (LinkedHashMap), unchanged since 
from: sftp://localhost:2222/invoices?noop=true&;..., which is not file content: 
marshal it first (marshal: csv, for the file name invoices-2026-11-01.csv), or 
set the body to the text)
   ```
   
   The split set that body. The Splitter removes the message history from each 
item (`Splitter.copyAndPrepareSubExchange`), so the history of an item starts 
inside the split, and every step in it saw the same body type. 
`BodyFacts.setBy` then fell back to "unchanged since from:".
   
   ## Change
   
   When no step of the history changed the body type, and the first step of the 
history has a split among its parents, `setBy` names that split: `the body is a 
Map (LinkedHashMap), set by split at sftp-transfer.camel.yaml:27`.
   
   The step itself does not count. So a route that starts with a split still 
says "unchanged since from:" for the message that reaches the split, and for 
the message that goes on after it.
   
   ## Tests
   
   - `BodyFactsTest`, three new tests. A split item, and a split item sent on 
to another route with `direct:`, both say "set by split". Both fail without the 
change ("unchanged since from: direct://split"). The message after the split 
still says "unchanged since from: direct://afterSplit".
   - camel-core: `BodyFactsTest` and `BodyFactsOtherBodiesTest`, 19 tests.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF
   


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