davsclaus opened a new pull request, #28397:
URL: https://github.com/apache/camel/pull/28397
_Claude Code on behalf of davsclaus_
This group adds the catalog body types (CAMEL-24961) for the seven ignite
components (ignite-cache, -compute, -events, -idgen, -messaging, -queue and
-set) and for ehcache, jcache and state-store. Each change is an `@BodyTypes`
annotation on the Endpoint, plus the JSON it generates and the catalog copy.
The ignite-cache doc page had its body text corrected.
**What the catalog says now**
The operation (or action) is an option or a header. None of the ignite
producers has a default operation, so their outputs are listed by option.
| Component | Consumer | Producer input | Producer output |
|---|---|---|---|
| ignite-cache | the new value of the changed entry, with the key, the old
value and the event in headers; a List of the events with
oneExchangePerUpdate=false | PUT and REPLACE store the body under the key of
the CamelIgniteCacheKey header (a Map body puts all its entries); GET and
REMOVE take the key from that header or else the body (a Set is several keys);
QUERY an Ignite Query | the value, null, or a Map for GET; `Integer` for SIZE;
an Iterator for QUERY; unchanged for the others |
| ignite-compute | | the job: an IgniteCallable, IgniteRunnable,
IgniteClosure or ComputeTask, or a Collection of them; the argument with
taskName | the result of the job; null for RUN; a List for BROADCAST |
| ignite-events | an `org.apache.ignite.events.Event` | | |
| ignite-idgen | | `any`: the amount for ADD_AND_GET and GET_AND_ADD | a
`Long` |
| ignite-messaging | the object that was sent | the object; a Collection is
one message per element in UNORDERED mode | unchanged |
| ignite-queue, ignite-set | | `any` | by operation: the element, `Boolean`,
`Integer`, an Iterator, an `Object[]`, a List for DRAIN, or unchanged |
| ehcache | the new value of the entry, with the key, the event and the old
value in headers; no body for REMOVED, EXPIRED and EVICTED | the value for PUT,
PUT_IF_ABSENT and REPLACE, a Map for PUT_ALL, unless the CamelEhcacheValue
header gives it | the value for GET, or the body as it was when the key is
missing; a Map for GET_ALL; unchanged for the writes |
| jcache | the value, with the key and the event in headers | the value for
PUT and the other writes, a Map for PUTALL | the value or null for GET; the old
value for the GETAND* actions; a Map for GETALL; the result of INVOKE;
unchanged for the writes |
| state-store | | the value for put and putIfAbsent | the stored, previous
or removed value, or null; `Boolean` for contains; the `Set<String>` of keys;
`Integer` for size; null for clear |
**Checked at runtime.** The tests below are throwaway and not part of the PR.
- **Setups:**
- an embedded Ignite node;
- ehcache with the default configuration and with an XML configuration,
for the events;
- jcache on a Hazelcast member, as in the module tests;
- the in-memory state-store.
- **Inputs:** text, bytes, a stream, a file, a Map, a POJO, an Integer and
no body, through every operation.
- **Consumers:** each was checked with real events.
Not run:
- a stream or a file into an Ignite cache, queue or set: the test JVM lacked
`--add-opens java.io`, and Ignite could not marshal them;
- compute with a Collection of lambdas, and EXECUTE with a ComputeTask (the
module tests cover both);
- the other state-store backends and jcache providers;
- the EXPIRED and EVICTED events.
**Choices**
- GET is in the `unknown` default of the cache producers, as for caffeine:
it gives the cached value, or null, or the body as it was.
- The ignite producers have no default operation, so their default sides
cover all operations, and byOption narrows them.
- idgen takes `any`, because only the two ADD operations read the body.
**Doc fix**
- ignite-cache: the key is not always in the header. GET and REMOVE take it
from the body when the header is not set, and a PUT of a Map puts all its
entries.
PR #28364 changes what an unknown action does for producers that take the
operation from a header, such as ehcache. It does not change the bodies.
**Bugs found, not fixed here.** The JIRAs, one per component, will follow.
- **ignite-cache:**
- With fireExistingQueryResults=true, the consumer builds an exchange with
the value and the key header, but then processes another one. So the route gets
a `Cache.Entry` body without CamelIgniteCacheKey.
- A PUT of a Map leaves a null body, ignoring
propagateIncomingBodyIfNoReturnValue.
- A Map can never be stored as one value under a key, even with the key
header or treatCollectionsAsCacheObjects=true.
- **ignite-cache, -idgen, -queue, -set:** no operation fails with a
NullPointerException, not a clear error.
- **ignite-idgen:**
- GET, GET_AND_INCREMENT and INCREMENT_AND_GET fail on a body that is not
a number, which they do not use: the body is converted before the operation is
picked.
- ADD_AND_GET with no body fails with a NullPointerException.
- **ignite-compute:**
- A null body fails with a NullPointerException on `job.getClass()`. For
APPLY and the AFFINITY operations, building the error message itself fails.
- RUN and AFFINITY_RUN leave a null body, ignoring
propagateIncomingBodyIfNoReturnValue.
- **ignite-queue, ignite-set:** ADD, CONTAINS, REMOVE and RETAIN_ALL with no
body fail with a NullPointerException.
- **ehcache:**
- PUT, PUT_IF_ABSENT or REPLACE with no body and no CamelEhcacheValue
header stores the Camel `DefaultMessage` object.
- valueType without keyType fails with "keyType cannot be null".
- Without a cacheManager or a configuration, each endpoint URI builds its
own CacheManager, so `ehcache:x` and `ehcache:x?action=GET` do not share
entries.
- A consumer on a cache that has no Ehcache configuration gets no events,
with no warning.
- **jcache:** PUTALL with a body that is not a Map fails with "map is null".
- **state-store:** a stream body is stored as the stream, so it is read
once, or its StreamCache is shared across exchanges.
**Local checks**
- The changed modules build, with no change to the generated files after the
build.
- The catalog copies equal their modules.
- camel-catalog, camel-yaml-dsl-validator and camel-jbang-core tests pass.
- The Endpoint and Component DSLs regenerate with no change.
🤖 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]