Claus Ibsen created CAMEL-27423:
-----------------------------------

             Summary: camel-support - the body origin of a split item names the 
split, not the consumer
                 Key: CAMEL-27423
                 URL: https://issues.apache.org/jira/browse/CAMEL-27423
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 4.24.0


{{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, which is false.

Seen in the AI benchmark (connect-sftp-transfer step 2), in the store error of 
CAMEL-27151. The route unmarshals a CSV file and splits the rows, and an 
{{onException}} stores a row that failed:

{noformat}
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)
{noformat}

The split set that body: each item is a row of the CSV. 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 falls back to "unchanged since from:".

Fix: when no step of the history changed the body type, and the first step of 
the history is inside a split, name the split as the step that set the body:

{noformat}
the body is a Map (LinkedHashMap), set by split at sftp-transfer.camel.yaml:27
{noformat}

After the split, the message goes on with its own body, and it keeps "unchanged 
since from:" when the split did not set that body. The same text is in the 
errors of camel-file, camel-ftp and the Simple language.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to