Repository navigation
CAMEL-25749: a read on a body that is still the payload, or an iterator, says what the body is and what to write - #28066
Conversation
…p that set it, and what to write; the existing body hints move onto it
BodyFacts.describe(exchange) says what the body is in plain words and,
from the message history, the step that set it ("the body is a Map
(LinkedHashMap), set by unmarshal at orders.yaml:9", or "unchanged since
from: file://orders"). BodyFacts.hint(exchange, need[, target]) says what
to write for what the failing step needed: DATA (it reads fields), BYTES
(it writes or sends the payload) or A_BODY (it needs a body at all), in the
data format the Content-Type, the file name or the text names.
The sentences that existed move onto it, so the wording is one: the http
producer (CAMEL-25309), the platform-http reply and the file write
(CAMEL-25751), Groovy on text (CAMEL-25330), unmarshal on a null body
(CAMEL-25285), jsonpath and jq on a null body (CAMEL-24838), and a missing
key of the body Map (CAMEL-25322). The three copies of the Content-Type to
data format mapping are gone.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…or, says what the body is and what to write
The failures that had no sentence get the BodyFacts one: simple and bean
OGNL on the message body - a method or property ${body.qty}, ${body.size()},
or a key ${body[status]} - and Groovy body.sku on the body itself, when the
body is the payload as text, bytes, a stream or the file as read, or an
iterator. So ${body.qty} on the cached stream of an HTTP request says to
unmarshal it in the data format of its Content-Type, ${body[status]} on the
file consumer's body says the same for the file name, and ${body.size()} on
sql's StreamList says an iterator has no size. A name an object does not
have still reports only the wrong name.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com> # Conflicts: # components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyExpression.java # core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleSyntaxHintsTest.java
|
🧪 CI tested the following changed modules:
🔁 6 tests passed only after a retry on JDK 25 (6 retried attempts) Recovered flaky tests on JDK 25 (6)
🔬 Scalpel shadow comparison — Scalpel: 490 of 706 tested, 27 compile-only — current: 492 all testedMaveniverse Scalpel detected 490 affected modules (current approach: 492). Skip-tests mode would test 490 modules (3 direct + 487 downstream), skip tests for 27 (generated code, meta-modules) Modules only in current approach (2)
Modules Scalpel would test (490)
Modules with tests skipped (27)
Build reactor — dependencies compiled but only changed modules were tested (3 modules, 23.6s total)Total reactor time: 23.6s
Top 20 slowest modules:
|
What
The second part of CAMEL-25749: the body failures that had no sentence get the
BodyFactsone (#28059, merged).simple and bean OGNL on the message body (
BeanExpression) now say what the body is and what to write, when the body is the payload (text, bytes, a stream, the file as read) or an iterator:${body.qty}(the body is a cached stream (ByteArrayInputStreamCache): unmarshal it first (unmarshal: json, for the Content-Type application/json) to read its fields)${body[status]}Key: status not found in bean: ... (the body is the file as read (a GenericFile): unmarshal it first (unmarshal: json, for the file name order-1003.json) to read its fields)${body.size()}(the body is an iterator (ResultSetIterator): it has no size and can be read once: split it, or have the producer give a List)With the message history on, each also names the step that set the body.
Groovy
body.skuon the body itself (the file as read, a stream) gets the same sentence. Before, only a read on text bytes or characters did (CAMEL-25330).These are the failures the local-model benchmark met:
${body.qty}on the request's stream cache (contracts-openapi-server, r17);${body.size()}on the iterator (connect-service-sql, r17);${body[status]}on a GenericFile (round 2).Kept:
IndexOutOfBoundsException, and the method failure aRuntimeBeanExpressionException, with the sentence in the place the Map-key hint (CAMEL-25322) already uses.Tests
SimpleSyntaxHintsTest(camel-core): the stream cache with a JSON Content-Type, the iterator, the GenericFile with a file name, and an object whose wrong name gets no body sentence. 30 tests.GroovyMissingPropertyHintTest(camel-groovy):body.skuon a cached stream. 13 tests.SimpleTest,SimpleOperatorTestand the bean tests (288, 0 failures), andBodyFactsTest;Claude Code on behalf of davsclaus
🤖 Generated with Claude Code