oscerd opened a new pull request, #26113:
URL: https://github.com/apache/camel/pull/26113
Five small items found while auditing `components/camel-infinispan`, grouped
because each is a couple of
lines.
### 1. `CamelInfinispanOperationResult` is a phantom header — deprecated
`InfinispanConstants#RESULT` has **zero** readers or writers in main or test
sources, yet it is published in
both `infinispan.json` and `infinispan-embedded.json` and rendered
throughout the docs — with the
description of `CamelInfinispanOperationResultHeader`, which is the option
that actually names the result
header. So the docs advertised two headers for one job and the more
obvious-looking one did nothing.
History explains it: when the QUERY operation was contributed in CAMEL-9624
(2016) the result *was* read
from this header. It became dead when `setResult` moved to
`RESULT_HEADER`/the message body.
The constant is kept and marked `@Deprecated` with a `deprecationNote`
rather than deleted, so nothing that
imports it stops compiling. Upgrade note added for 4.23.
### 2. `CamelInfinispanIgnoreReturnValues` was labelled a consumer header
It is read on the producer path —
`InfinispanEmbeddedManager#getCache(Message, String)` — and its
description ("a write operation's return value") is producer semantics. Only
its group in the catalog and
the docs changes.
### 3. Consumer stop order
`InfinispanRemoteConsumer` and `InfinispanEmbeddedConsumer` both called
`super.doStop()` *before* stopping
the handler that owns the cache listener, the reverse of `doStart()`. An
event arriving between the two
calls was processed against a consumer that was already stopped. Now the
listener goes first.
### 4. Idempotent repository: one round trip instead of two
```java
// before
if (getCache().containsKey(key)) {
return false;
}
Boolean put = getCache().put(key, true);
return put == null;
// after
return getCache().putIfAbsent(key, true) == null;
```
Same outcome, atomic, and it still leaves the lifespan of an existing entry
untouched, which is what the
original comment was protecting. It halves the network round trips of every
idempotency check on the Hot Rod
repository. The remote cache is obtained with `Flag.FORCE_RETURN_VALUE`
(CAMEL-9840), so the previous value
is reported and the `== null` test is sound there too.
### 5. Typos
`"Cannot remote the listener"` → `remove`; `"InifinispanConfiguration"` →
`InfinispanConfiguration` (the
latter is user-visible, it is in the `CamelInfinispanQueryBuilder` header
description).
### Verification
`mvn clean install` on `components/camel-infinispan` is green — 110 tests,
including the Hot Rod
integration tests against a testcontainer and both Spring
idempotent-repository ITs, which exercise the
`putIfAbsent` change end to end. Full reactor `mvn clean install -DskipTests
-Dquickly` green; catalog and
endpoint-DSL descriptors regenerated and committed (the DSL regeneration
needs a build without `-Dquickly`).
---
_Claude Code on behalf of oscerd_
🤖 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]