davsclaus opened a new pull request, #28242:
URL: https://github.com/apache/camel/pull/28242
Stacked on #28241. This is the second slice of the catalog body types
(CAMEL-24961): the rest of the pilot set, except paho-mqtt5 and mongodb. Their
integration tests need a broker container, so their values could not be checked
at runtime yet.
**Components**
| Component | Side | Body | Where |
|---|---|---|---|
| platform-http | consumerOut | stream (the stream cache with Vert.x), bytes
(Spring Boot), null (a GET), map (a form), file (an upload); pojo with
useBodyHandler=false | DefaultHttpRequestBodyHandler.java:47,
VertxPlatformHttpConsumer.java:557, :612; SpringBootPlatformHttpBinding |
| | consumerReply | null, text, bytes, stream; a Map or a List fails |
VertxPlatformHttpSupport.java:189-255 |
| rest | consumerOut / consumerReply | as the HTTP consumer; map, list or
pojo with bindingMode json | RestEndpoint.java:486,
RestBindingAdvice.java:262-284, :449 |
| | producerIn / producerOut | as the http producer; any with bindingMode
json; pojo with outType | RestProducer.java:97, :397 |
| rest-openapi | consumerOut / consumerReply | as rest (added to the
producer sides of #28241) | RestOpenApiProcessor.java:330 |
| ftp, ftps, sftp | consumerOut | file (a RemoteFile); stream with
streamDownload; null with download=false; with preMove its content (bytes) |
GenericFileEndpoint.java:1671, FtpOperations.java:501, :512,
GenericFileConsumer.java:586 |
| | producerIn / producerOut | text, bytes, stream, file / unchanged |
FtpOperations.java:789, SftpOperations.java:1231 |
| jms, activemq, activemq6, amqp | consumerOut | text, bytes, map, stream,
null by the JMS message type; pojo with mapJmsMessage=false or
objectMessageEnabled | JmsBinding.java:195-229 |
| | consumerReply, producerIn | text, bytes, stream, file, map; pojo only
with objectMessageEnabled | JmsBinding.java:611-719 |
| | producerOut | unknown: unchanged for InOnly (or disableReplyTo), the
reply for InOut | JmsProducer.java:158, :163 |
| kafka | consumerOut | text or null (StringDeserializer, a tombstone);
bytes with ByteArrayDeserializer; list with batching |
KafkaRecordProcessor.java:49 |
| | producerIn / producerOut | any, converted for the valueSerializer (a Map
is sent as its toString()) / unchanged | KafkaProducer.java:272,
ProducerUtil.java:41-55 |
| aws2-sqs | consumerOut / producerIn | text | Sqs2Consumer.java:308,
Sqs2Producer.java:103 |
| | producerOut | unchanged for a send; the AWS SDK response by operation |
Sqs2Producer.java:116, :160-238 |
| log, mock | producerIn / producerOut | any / unchanged |
LogProducer.java:41, MockEndpoint.java:1779 |
| scheduler, quartz | consumerOut | null | SchedulerConsumer.java:54,
QuartzMessage.java:37 |
**Data formats**
| Data format | marshalIn | marshalOut | unmarshalIn | unmarshalOut |
|---|---|---|---|---|
| csv | map or list | stream (csv) | text, bytes, stream, file | list of
lists (or of maps with useMaps); an Iterator with lazyLoad |
| jacksonXml | any (text is written as an XML value) | stream (xml) | text,
bytes, stream, file | map; list with useList; a pojo with unmarshalType |
| snakeYaml | any | stream (yaml) | text, bytes, stream, file | map or list;
a pojo with unmarshalType |
The body after marshal is what `MarshalProcessor` sets: the stream cache, or
a byte array when stream caching is off (MarshalProcessor.java:92-97).
**Languages** (`setBody` and `transform` keep the result as it is:
SetBodyProcessor.java:47)
| Language | expressionIn | expressionOut |
|---|---|---|
| simple | any | unknown: text for a text with functions, the value itself
for a single function such as `${body}` |
| constant | | text (String) |
| jsonpath | any (JSON text or parsed; a POJO through Jackson) | unknown:
the selected value (Map, List, text, number); text or list with writeAsString |
| xpath | text, bytes, stream, file, pojo (a DOM) | pojo
(org.w3c.dom.NodeList); text, value or Node by resultQName |
| groovy | any | unknown: what the script returns |
| jq | text, bytes, stream, file, map | pojo (a JsonNode), a list for
several results, null for none |
**Checked at runtime.** I compared every value with the body types the
message history recorded:
- **Component tests:** jms, kafka, aws2-sqs, csv, jacksonxml, snakeyaml,
jsonpath, groovy and jq.
- **ftp integration tests:** 261 coverage dumps (most ftp tests are
integration tests). They give a RemoteFile, the stream cache with
streamDownload, a byte array with preMove, null with download=false, and
unchanged after a write.
- **Reference routes:**
- platform-http: the stream cache, a HashMap for a form, null for a GET;
- rest: null, a LinkedHashMap with the json binding;
- scheduler, quartz (through cron): null;
- the languages: a String, a LinkedHashMap or LinkedList from jsonpath, a
DTMNodeList from xpath, an IntNode from jq.
**camel_catalog_doc**
- It gives the body types as one line per side, as compact as the options,
for example `text (java.lang.String). The result of the transformation. With
output=bytes: bytes (byte[]); ...`, with a shorter hint.
- An answer is now cut at 18 000 characters instead of 16 000. Even with the
compact lines, the four sides of the jms components took the room of 5 of the
25 options that `limit=25` asks for in `CatalogDocComponentAnswerTest`. 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**
- `CatalogDocsTest` covers the lines for a component, a data format and a
language, and a component without body types (mongodb).
- These pass: camel-catalog (1103 tests), the catalog doc tests of
camel-jbang-core, and the catalog tests of camel-jbang-mcp and the TUI.
_Claude Code on behalf of davsclaus_
🤖 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]