Repository navigation
CAMEL-24961: camel-catalog - the body a component or data format needs, and the body it leaves after a step - #28241
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>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Croway
left a comment
There was a problem hiding this comment.
Two points on the vocabulary and the build check, worth settling before the enum ships as @since 4.24 API.
Claude Code on behalf of Croway
…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>
gnodet-bot
left a comment
There was a problem hiding this comment.
Two small points worth settling before this SPI is frozen at @since 4.24.
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>
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier review — both issues have been addressed.
- [
carrier()→carriers()rename inBodyType.When] — ✅ addressed - [
isUnknown()Javadoc missing empty-carriers fallback] — ✅ addressed
No new issues in the latest commits. LGTM.
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>
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier review — the previous two findings are addressed, and the new commit is clean.
New commit (07e849749739): adds @JsonIgnore on bodyTypes in Schema.java (the YAML DSL Maven plugin’s deserialization class). This is the exact mirror of the existing @JsonIgnore public ObjectNode exchangeProperties; already in the same class — consistent, correct, and described in the PR body. No new issues.
LGTM.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 661 of 707 tested, 23 compile-only — current: 75 all testedMaveniverse Scalpel detected 661 affected modules (current approach: 75). Skip-tests mode would test 661 modules (19 direct + 646 downstream), skip tests for 23 (generated code, meta-modules)
|
| Module | Duration | Status |
|---|---|---|
| Camel :: SQL | 43.0s | SUCCESS |
| Camel :: REST OpenApi | 18.9s | SUCCESS |
| Camel :: Catalog :: Camel Catalog | 18.8s | SUCCESS |
| Camel :: Kamelet | 15.6s | SUCCESS |
| Camel :: Docs | 14.0s | SUCCESS |
| Camel :: Jackson | 10.3s | SUCCESS |
| Camel :: Maven Plugins :: Camel Maven Package | 8.5s | SUCCESS |
| Camel :: Tooling :: Model | 4.6s | SUCCESS |
| Camel :: API | 4.4s | SUCCESS |
| Camel :: File | 4.0s | SUCCESS |
| Camel :: SPI Annotations | 2.6s | SUCCESS |
| Camel :: Cron | 2.2s | SUCCESS |
| Camel :: Timer | 1.6s | SUCCESS |
| Camel :: XSLT | 1.6s | SUCCESS |
| Camel :: Seda | 1.3s | SUCCESS |
| Camel :: YAML DSL :: Maven Plugins | 0.9s | SUCCESS |
| Camel :: Direct | 0.7s | SUCCESS |
| Camel :: HTTP | n/a | |
| Camel :: JBang :: Core | n/a |
Top 20 slowest modules:
Camel :: SQL(43.0s)Camel :: REST OpenApi(18.9s)Camel :: Catalog :: Camel Catalog(18.8s)Camel :: Kamelet(15.6s)Camel :: Docs(14.0s)Camel :: Jackson(10.3s)Camel :: Maven Plugins :: Camel Maven Package(8.5s)Camel :: Tooling :: Model(4.6s)Camel :: API(4.4s)Camel :: File(4.0s)Camel :: SPI Annotations(2.6s)Camel :: Cron(2.2s)Camel :: Timer(1.6s)Camel :: XSLT(1.6s)Camel :: Seda(1.3s)Camel :: YAML DSL :: Maven Plugins(0.9s)Camel :: Direct(0.7s)
The catalog has every option and every header of a component, and nothing about the message body. So a person, an IDE, the Camel MCP tools and the YAML validator cannot answer the question asked most when writing the next step: what is the body after this step? This adds it for a first slice, as the design note on CAMEL-24844 (2026-10-05) proposed.
The shape. A
@BodyTypesannotation on the endpoint, data format or language class has one entry per side:consumerOutconsumerReplyproducerInproducerOutmarshalIn/Out,unmarshalIn/OutexpressionIn/OutEach side has carriers:
null,text,bytes,stream,file,value,map,list,iterator(read once, with no size and no index) andpojo;unchanged,anyorunknown.A side can also have:
The package plugin writes a
bodyTypessection into the catalog JSON next toheaders, one line per side:No guesses.
unknownis declared on purpose, for a body that depends on the other system or on a class the user configures.unchangedis on what a step needs, oranyon what it leaves;protobufJacksonextends the jackson data format, but its payload is not JSON.bodyTypes, the way it ignoresexchangeProperties.The first slice. The top 10 schemes of 1712 real route files, plus the json data format, which has 92% of the data format uses. Each value is read from the code that sets the body (main @ 5c9d5bc):
Checked at runtime. The message history records the body type at each step (CAMEL-25750), and the route coverage dump carries it. I ran two surveys with message history forced on by a context service plugin (
ContextServicePlugin) on the test classpath, with no test changed:ContextTestSupport, which does not dump the coverage.Every recorded type fits the declared carriers:
For AI agents:
camel_catalog_docreturns the body types, with a hint that says what each side means, so an agent can read them before it writes the next step.Next:
Tests
JsonMapperTest: the round trip for a component, a data format and a language; nothing written when there are no body types.EndpointSchemaGeneratorMojoTest: the sides in order, no inheritance, and the eight shapes the build rejects.CatalogDocsTest:camel_catalog_docfor xslt, json and kafka (kafka has none).Docs: "Body types in the Catalog" on the Camel Catalog page, and
@BodyTypeson the endpoint annotations page.Claude Code on behalf of davsclaus
🤖 Generated with Claude Code