davsclaus opened a new pull request, #28282:
URL: https://github.com/apache/camel/pull/28282
Stacked on #28276. This group of the catalog body types (CAMEL-24961) takes
the most used components in the route files that had none yet: jira, github2,
pqc, dns, caffeine-cache, caffeine-loadcache, infinispan and
infinispan-embedded.
**What the catalog says now**
| Component | Consumer | Producer input | Producer output |
|---|---|---|---|
| jira | an Issue (newIssues), a Comment (newComments); for watchUpdates the
new value of a field (`pojo` or null), or the Issue with
sendOnlyUpdatedField=false | `text`, `bytes`, `stream` or `file` per type: the
description, the comment, the file to attach; `any` for the types that read
only headers | the Issue for addIssue and fetchIssue, a List of Comment for
fetchComments; `unchanged` for the other types |
| github2 | the commit message as `text` (a GHCommit with
commitMessageAsBody=false), a GHPullRequest, GHIssueComment or GHTag, the type
of an event as text | `text`, `bytes`, `stream` or `file` for the comment, the
issue and the commit status; `any` otherwise | the GitHub object of the type,
such as the GHIssue of createIssue; the content of the file for getCommitFile |
| pqc | (producer only) | `text`, `bytes` or `stream` to sign and verify;
the SecretKeyWithEncapsulation to extract from; `any` for the key operations |
`unchanged` for signing and the key operations (the results are in headers);
the SecretKeyWithEncapsulation or the SecretKey for the key encapsulation
operations |
| dns | (producer only) | `any`: the name is in a header | an InetAddress
(ip), an array of Record (lookup), a Message (dig), text (wikipedia) |
| caffeine-cache, caffeine-loadcache | (producer only) | `any`: the value
for PUT and PUT_ALL, unless the CamelCaffeineValue header gives it | the value
for GET, or the body as it was when the key is not there; a Map for GET_ALL and
AS_MAP; `unchanged` for the other actions |
| infinispan, infinispan-embedded | no body: the event is in headers |
`any`: the key and the value come from headers or options | the result of the
operation: the previous value for PUT, the value for GET, a Boolean, an
Integer, a List, a CompletableFuture for the ASYNC operations; `unchanged` for
PUTALL and CLEAR, and with resultHeader |
**The validator.** An option a body depends on now makes the body not known
also when another option of the step names a body, as the `BodyType` javadoc
says ("with another value the body is not known, unless byOption says it"). For
example, xslt with output=bytes and a resultHandlerFactory gives what the
factory makes, not bytes. Before, the option that named a body won. This
matters here for infinispan, whose operations name a body while resultHeader
keeps the body.
**Checked at runtime.** Routes run with `camel run` logged the class of the
body after each step:
- **pqc:**
- sign and verify keep the body, and set the signature (bytes) and the
verification (true) in headers;
- the key encapsulation operations give the SecretKeyWithEncapsulation and
the SecretKey.
- **dns:**
- ip gives an Inet4Address, lookup an array of Record, dig a Message (with
the CamelDnsType header) and wikipedia text.
- **caffeine-cache:**
- PUT, PUT_ALL, INVALIDATE and CLEANUP keep the body;
- GET gives the value, and keeps the body when the key is not there;
- GET_ALL and AS_MAP give a Map;
- the CamelCaffeineValue header is stored instead of the body.
- **infinispan-embedded:**
- PUT stores the CamelInfinispanValue header, not the body, and gives the
previous value;
- GET gives the value or null, CONTAINSKEY a Boolean, SIZE an Integer,
PUTASYNC a CompletableFuture and STATS a Stats;
- resultHeader keeps the body, and CLEAR keeps it too;
- the consumer gives no body.
- **Read from the code only:** jira, github2, caffeine-loadcache and
infinispan (remote), which shares its producer with infinispan-embedded.
**Docs fixed.** These pages said things about the body that the code does
not do:
- **jira:**
- addComment takes the comment, not the description;
- attach takes a file, or text, bytes or a stream;
- transitionIssue takes an optional comment.
- **github2:**
- the pullRequestComment consumer gives a GHIssueComment;
- the event consumer gives the type of the event, with the GHEventInfo in
a header;
- pullRequestState takes the description as the body and the commit sha in
a header.
- **dns:** ip resolves a domain to its address, and lookup gives an array of
Record.
- **infinispan and infinispan-embedded:**
- the result is in the body (or the resultHeader header), not in
CamelInfinispanOperationResult, which is never set;
- the put example now sets the value header, since the body is not the
value.
**Measured.**
- I ran the validator over the 1204 human-written and 1209 model-written
route files, and the reports are the same as with #28276.
- The share of the endpoint uses in the human-written routes whose component
has body types goes from 91.4% to 93.0%.
**Tests**
- `TextBodyFlowTest`:
- `testTheBodyOfCachesAndSigning`: parsed data sent to pqc is reported, a
caffeine PUT keeps the parsed data for the file producer after it, and an
infinispan GET says nothing;
- `testAnOptionTheBodyDependsOnOutweighsAnotherOption`: xslt with
output=bytes is reported, and with a resultHandlerFactory too it is not.
- These pass:
- the 285 tests of camel-yaml-dsl-validator;
- the 265 validator and catalog doc tests of camel-jbang-core;
- the build of camel-yaml-dsl-deserializers, which reads the catalog.
- The answers of camel_catalog_doc stay under 18 000 characters:
infinispan-embedded, the largest of this group, is 16 371.
_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]