Repository navigation
CAMEL-24961: camel-catalog - the body types of platform-http, rest, ftp, jms, kafka, aws2-sqs, paho-mqtt5, mongodb, the csv, jacksonXml and yaml data formats, and the languages - #28242
Conversation
…s, and the body it leaves after a step A @BodyTypes annotation on the endpoint, data format or language class says the body per side (consumerOut, consumerReply, producerIn, producerOut, marshal, unmarshal and expression in and out): its carriers (null, text, bytes, stream, file, value, map, list, pojo, unchanged, any, unknown), the Java type when it is always the same, the format, the options it depends on, the body for other option values, and a description. The package plugin writes it as a bodyTypes section of the catalog JSON and checks that each side fits the kind and that the options it names exist. A subclass declares its own. The first slice: file, direct, seda, timer, cron, kamelet, http, https, rest-openapi, xslt, sql and the json data format (jackson), read from the code that sets the body and checked against the body types the message history records when routes run. camel_catalog_doc returns them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…tp, jms, kafka, aws2-sqs, the csv, jacksonXml and yaml data formats, and the languages The second slice of the catalog body types: - components: platform-http, rest (and the rest-openapi consumer), ftp, ftps, sftp, jms, activemq, activemq6, amqp, kafka, aws2-sqs, log, mock, scheduler, quartz; - data formats: csv, jacksonXml, snakeYaml; - languages: simple, constant, jsonpath, xpath, groovy, jq. Each value is read from the code that sets the body, and checked against the body types the message history recorded when the tests of the modules and reference routes ran (the ftp integration tests included). camel_catalog_doc gives the body types a line per side, and its answer is cut at 18000 characters instead of 16000, so the four sides of the jms components leave the options a limit asks for room. 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:
|
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM overall. Two nits worth fixing before merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
paho-mqtt5: the consumer gives the payload as a byte array, the producer sends what converts to one and leaves the body unchanged. mongodb: the consumer gives a Document (or null for a change without its full document with changeStreams); the producer takes a document or a query, and leaves a body by operation: a Document or null for a find of one, a List for findAll, findDistinct and aggregate, a Long for count, the result of the driver for the other writes. Read from the code that sets the body, and checked against a mosquitto and a mongodb container started with camel infra. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…ts an option value without carriers
From the review of PR 28241:
- An iterator is read once and has no size and no index, so tooling that
reads list as a List accepts ${body.size()} or ${body[0]} on it, which fail
at runtime. The new iterator carrier names it: sql with outputType=StreamList
gives an iterator, not a list.
- A @BodyType.When with no carriers (carrier = {}) wrote "carriers": [] into
the catalog. The build now rejects it, as it does a side without carriers.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…MEL-24961-catalog-body-types-2 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
… camel_catalog_doc says unknown for no carriers From the review of PR 28242: - The csv data format with lazyLoad=true gives an iterator, with the iterator carrier of PR 28241, not a list. - camel_catalog_doc says unknown for a body without carriers, instead of failing. The build rejects it now, but a catalog read from elsewhere may have one. - Sqs2Endpoint imports org.apache.camel.spi.* already: only the import of the nested BodyType.Carrier stays. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier review — both issues have been addressed.
✅ carriers() empty-list guard — fixed. The isEmpty() guard now returns "unknown" before attempting subList(0, -1), and the aBodyWithoutCarriersIsUnknown test covers the byOption empty-carriers path that triggered the original finding.
✅ Redundant explicit imports in Sqs2Endpoint — fixed. The BodyType and BodyTypes imports were removed (already covered by org.apache.camel.spi.*); BodyType.Carrier is correctly kept as a separate explicit import since package wildcards do not cover nested types.
LGTM.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
The attribute holds an array, and the catalog JSON and BodyTypeModel call the same field carriers. The Javadoc of BodyTypeModel.isUnknown() says that a side with no carriers is unknown too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…MEL-24961-catalog-body-types-2
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
Previous findings are all addressed. LGTM.
The new commits (617b873 merge from parent branch + 15aaf46) are a clean rename of carrier() → carriers() in the @BodyType.When annotation and all 20+ usage sites, plus the compact body-types line format in CatalogDocs.java merged from the parent branch. Both changes are correct and well-tested.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
…e data format and language schemas Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…-types' into feature/CAMEL-24961-catalog-body-types-2
gnodet-bot
left a comment
There was a problem hiding this comment.
💡 Minor style nit on the new bodyTypes formatting helper.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
…n read as a list, as the carriers do Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
Previous findings are all addressed. LGTM.
The orList() helper cleanly eliminates the formatting inconsistency between dependsOn and carriers() — both now share the same comma-separated Oxford-ish style, and the JMS producerIn test confirms the 3-item case renders correctly.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
…atalog-body-types-2 Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🧪 CI tested the following changed modules:
🔁 5 tests passed only after a retry on JDK 21 (5 retried attempts) Recovered flaky tests on JDK 21 (5)
🔬 Scalpel shadow comparison — Scalpel: 500 of 707 tested, 24 compile-only — current: 500 all testedMaveniverse Scalpel detected 500 affected modules (current approach: 500). Skip-tests mode would test 500 modules (27 direct + 476 downstream), skip tests for 24 (generated code, meta-modules) Modules Scalpel would test (500)
Modules with tests skipped (24)
💡 Manual integration tests recommended:
Build reactor — dependencies compiled but only changed modules were tested (27 modules, 4m 56s total)Total reactor time: 4m 56s
Top 20 slowest modules:
|
Stacked on #28241. This is the second slice of the catalog body types (CAMEL-24961): the rest of the pilot set. paho-mqtt5 and mongodb are checked against containers started with
camel infra.Components
Data formats
The body after marshal is what
MarshalProcessorsets: the stream cache, or a byte array when stream caching is off (MarshalProcessor.java:92-97).Languages (
setBodyandtransformkeep the result as it is: SetBodyProcessor.java:47)${body}Checked at runtime. I compared every value with the body types the message history recorded:
camel infra run mosquittoandcamel infra run mongodb:camel_catalog_doc
text (java.lang.String). The result of the transformation. With output=bytes: bytes (byte[]); ..., with a shorter hint. A body without carriers says unknown.limit=25asks for inCatalogDocComponentAnswerTest. 18 000 is still far below the 38 K answer that a client rejected (CAMEL-25541). The camel-jbang-mcp page and the 4.24 upgrade guide say the new number.Tests
CatalogDocsTestcovers the lines for a component, a data format and a language, and a component without body types (jdbc).Claude Code on behalf of davsclaus
🤖 Generated with Claude Code