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

   _Claude Code on behalf of davsclaus_
   
   [CAMEL-25928](https://issues.apache.org/jira/browse/CAMEL-25928): the first 
PR of the plan in the JIRA. The components, data formats and languages have 
body types in the catalog (CAMEL-24961); this adds them for the EIPs.
   
   **Shape**
   - Three new sides on `@BodyTypes`:
     - `eipIn`: the bodies an EIP needs;
     - `eipOut`: the body after it;
     - `eipSteps`: the body its own steps start with.
   - A new member `from` on `@BodyType`, for an EIP whose body is the body of 
another model. Its value names that model's side:
     - `marshalOut`: what the data format of `marshal` leaves;
     - `producerOut`: what the producer of the endpoint of `to` or `enrich` 
leaves;
     - `consumerOut`: what the consumer of `poll` or `pollEnrich` receives;
     - `expressionOut`: the result of the expression of `setBody` or 
`transform`;
     - `steps`: what the steps of a block such as `filter` end with.
     - A side with `from` has no carriers of its own. This is a reference, not 
a copy, so the catalog says it once.
   - `SchemaGeneratorMojo` reads the annotation from the model class.
     - `BodyTypesHelper` checks it as it checks the other kinds: the sides of 
the kind, the carriers per side, the options, and that `from` names a side the 
body can come from.
     - `JsonMapper` reads and writes `bodyTypes` for `EipModel`, so 
`models/*.json` carry them.
   
   **The EIPs** (69 model classes, all in camel-core-model):
   - *Body unchanged*: the set*, remove* and convert*To EIPs, log, validate, 
delay, throttle, sample, wireTap, threads, stop, rollback, throwException, 
pausable and resumable.
   - *From another model*: setBody, transform, marshal, unmarshal, to, toD, 
enrich, poll and pollEnrich.
     - `dependsOn` is `variableReceive`/`variableSend`, plus 
`aggregationStrategy` for enrich and pollEnrich.
   - *Blocks* (steps start with the body, `eipOut` from `steps`): choice, when, 
otherwise, filter, doTry, step, pipeline, circuitBreaker, onFallback, saga, 
a2aSubTask, idempotentConsumer, loadBalance, cache, policy, transacted, loop 
and multicast.
     - doCatch and doFinally have `eipOut` from `steps` too, but their steps 
start with an unknown body.
   - *Their own rule*:
     - split: each part in its steps, the body unchanged after it;
     - aggregate: the aggregated message in its steps, the body unchanged after 
it;
     - sort: a List;
     - tokenizer: text in, a `String[]` out;
     - claimCheck: by `operation`;
     - convertBodyTo: by `type`, for String, byte[], InputStream, Map and List.
   - *Unknown* (user code, or decided at runtime): bean, process, script, 
kamelet, transformDataType, recipientList, routingSlip, dynamicRouter and 
switch.
   
   EIPs implemented in other modules, such as `circuitBreaker` 
(camel-resilience4j, camel-microprofile-fault-tolerance), `a2aSubTask` 
(camel-a2a) and `tokenizer` (camel-langchain4j-tokenizer), have their body 
types on their model class too. The annotation is the contract every 
implementation keeps, and the next PR checks it at runtime in those modules.
   
   **Where they show**
   - The EIP pages get the _Message Body_ section through the shared 
`body-types.adoc` partial; `camel.js` renders `from`.
   - `camel catalog doc <eip>` prints them.
   - The MCP `camel_catalog_doc` returns them.
   - The Camel Catalog page of the user manual describes the EIP sides and 
`from`.
   
   **Tests**
   - `BodyTypesHelperEipTest`: the sides, `from`, and the checks that reject a 
wrong side.
   - `JsonMapperTest`: reading and writing EIP body types.
   - `CatalogDocsTest`: split and marshal.
   - `EipBodyTypesTest` (camel-core): a route for each core EIP of the 
unchanged, block and own-rule groups. It checks the body after the EIP, and at 
its first step, against the annotation of its model class: about 40 EIPs.
   - `CatalogDocTest`: `camel catalog doc eip:split` prints the table.
   - Local check: camel-package-maven-plugin 109 tests, catalog 1105, 
yaml-dsl-validator 295 (with `EipDocExamplesTest`), camel-jbang-core 2428 + 
241, no regeneration drift (YAML DSL, endpoint and component DSL).
   
   The validator does not read the EIP body types yet. That is the third PR of 
the plan: `TextBodyFlow` and `BodyTypeFlow` drop their own EIP tables for the 
catalog.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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