Repository navigation
camel-hazelcast: deprecate CamelHazelcastCacheType, which nothing sets or reads - #29959
Dhairya-007 wants to merge 6 commits into
Conversation
…s or reads
The header is documented for the multimap consumer, next to
CamelHazelcastCacheName, as "The type of the cache - here multimap". It
suggests the consumer tells the route what kind of cache the event came
from, but nothing in the component sets it - the listener path sets four
headers and this is not one of them:
public static void setListenerHeaders(Exchange ex, String listenerType, String listenerAction, String cacheName) {
ex.getIn().setHeader(HazelcastConstants.CACHE_NAME, cacheName);
HazelcastComponentHelper.setListenerHeaders(ex, listenerType, listenerAction);
}
public static void setListenerHeaders(Exchange ex, String listenerType, String listenerAction) {
ex.getIn().setHeader(HazelcastConstants.LISTENER_ACTION, listenerAction);
ex.getIn().setHeader(HazelcastConstants.LISTENER_TYPE, listenerType);
ex.getIn().setHeader(HazelcastConstants.LISTENER_TIME, new Date().getTime());
}
and no producer reads it either, so setting it changes nothing.
Deprecate it with a note saying what the listener does set. The kind of
cache is already in the endpoint scheme, and the sort of listener in
CamelHazelcastListenerType.
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. CACHE_TYPE/CamelHazelcastCacheType is verified unused — zero references outside its own declaration in HazelcastConstants.java. The @Metadata(deprecationNote=...) + @Deprecated pattern matches Camel's existing convention. Generated JSON is consistent with the annotation.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
davsclaus
left a comment
There was a problem hiding this comment.
Thanks for this! I checked CACHE_TYPE / CamelHazelcastCacheType against main: nothing in the repo sets or reads it, and it was not set in camel-2.25.x either, so deprecating it is right. The deprecationNote style matches the other components, and the two catalog JSON files are consistent.
HazelcastMultimapEndpointBuilderFactoryindsl/camel-endpointdsl/src/generated/...also needs regenerating: thehazelcastCacheType()header method gets@Deprecatedand the note, asInfluxDb2EndpointBuilderFactorydid in #29709. Otherwise CI will likely report uncommitted changes.- The hand-written consumer header tables still say the consumer sets it:
hazelcast-map-component.adoc:368("the type of the cache (e.g., map)") andhazelcast-replicatedmap-component.adoc:228. Could we drop those rows too? Editing the adoc also means regenerating the copies undercatalog/camel-catalog/src/generated/resources/.../docs/. - Could we add a short entry to
camel-4x-upgrade-guide-4_24.adoc, as #29709 did?
Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
✅ Generated files are up to dateAn earlier CI run reported uncommitted generated changes; the latest run no longer does. |
davsclaus
left a comment
There was a problem hiding this comment.
Thanks, the Regen commit added @Deprecated and the note to hazelcastCacheType() in HazelcastMultimapEndpointBuilderFactory, so the generated-files point is done. Two points are still open:
- The hand-written consumer header tables still say the consumer sets the header:
components/camel-hazelcast/src/main/docs/hazelcast-map-component.adoc:368andhazelcast-replicatedmap-component.adoc:228. Could we drop those two rows? Editing the adoc files also means regenerating their copies undercatalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/. - Please add a short entry for the deprecated
CamelHazelcastCacheTypeheader todocs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc, as #29709 did.
Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
|
🧪 CI tested the following changed modules:
🔁 1 test passed only after a retry on JDK 21 (2 retried attempts) Recovered flaky tests on JDK 21 (1)
🔬 Scalpel shadow comparison — Scalpel: 9 of 726 tested, 24 compile-only — current: 9 all testedMaveniverse Scalpel detected 9 affected modules (current approach: 9). Skip-tests mode would test 9 modules (4 direct + 8 downstream), skip tests for 24 (generated code, meta-modules) Modules Scalpel would test (9)
Modules with tests skipped (24)
All tested modules (36 modules, 6m 45s total)Total reactor time: 6m 45s
Top 20 slowest modules:
|
…, add an upgrade note The hand-written consumer header tables of hazelcast-map and hazelcast-replicatedmap still listed the header as something their consumer sets. They do not: HazelcastComponentHelper.setListenerHeaders sets the cache name, the listener type, the listener action and the listener time, and nothing in the component sets or reads the cache type. Dropped both rows, in src/main/docs and in the catalog copies. Added a section to the 4.24 upgrade guide, as apache#29709 did for camel-influxdb2. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Both done, thanks.
|
# Conflicts: # docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
davsclaus
left a comment
There was a problem hiding this comment.
Thanks @Dhairya-007, both open points are done:
- The
CamelHazelcastCacheTyperows are gone from the consumer header tables inhazelcast-map-component.adocandhazelcast-replicatedmap-component.adoc, and the catalog copies match. - The upgrade guide has an entry for the deprecated header. Its claim holds:
HazelcastComponentHelper.setListenerHeaderssets only the cache name, listener action, type and time, and nothing in the component refers toCACHE_TYPE.
- [Suggestion, optional]
camel-4x-upgrade-guide-4_24.adoc:8903-8915: users who are migrating do not need the component's internalsetListenerHeaderscode. One sentence would do the same job, for example: "The consumers setCamelHazelcastCacheName,CamelHazelcastListenerAction,CamelHazelcastListenerTypeandCamelHazelcastListenerTime, never the cache type."
LGTM.
Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
|
Thanks @Dhairya-007, this is approved and ready to merge, but it now conflicts with main. #29954 (camel-docker deprecations) was merged and also adds a section at the end of Claude Code on behalf of davsclaus |
|
@Dhairya-007 thanks, this one is approved, but it now conflicts with Claude Code on behalf of davsclaus |
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier review — all prior findings remain addressed.
New commits (adoc removals, upgrade guide entry, generated file regen) are correct and consistent:
CamelHazelcastCacheTypeverified unused across the entire hazelcast component —setListenerHeadersnever sets it; no consumer/producer reads it.- Adoc table removals are complete (
hazelcast-map-component.adocandhazelcast-replicatedmap-component.adoc). - Upgrade guide
setListenerHeaderscode snippet matches the actual source verbatim. - Catalog JSON files updated consistently in both source and catalog copy locations.
Needs a rebase on main due to conflict in camel-4x-upgrade-guide-4_24.adoc with other merged hazelcast header PRs (#29954, #29955, #29958). Once rebased, this is ready to merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
oscerd
left a comment
There was a problem hiding this comment.
Confirmed the claim: CACHE_TYPE (CamelHazelcastCacheType) is neither set nor read anywhere in the hazelcast main sources, only declared in HazelcastConstants. It sits right next to CACHE_NAME, which does carry a value, so the multimap docs read as if both work when only one does.
Deprecating it with a deprecationNote and the upgrade-guide entry is the right call, and the regen of the multimap and replicated-map docs plus the component JSON is included, with CI green. Small, accurate cleanup.
Claude Code on behalf of oscerd
Resolves the conflict with main in the 4.24 upgrade guide (both entries kept). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Problem
HazelcastConstantsdocuments a header for the multimap endpoint, right besideCamelHazelcastCacheName:Sitting next to the cache name, which the consumer really does set, "The type of the cache - here multimap" reads as something the consumer provides too. Nothing in the component sets it. The listener path sets four headers and this is not one of them:
No producer reads it either -
CamelHazelcastCacheTypeappears nowhere in the component apart from its own declaration - so setting it changes nothing. It is the only header of the multimap endpoint with neither alabelnor any code behind it.Fix
Deprecate the constant with a
deprecationNotesaying what the listener does set, so the catalog stops listing it forhazelcast-multimap. The kind of cache is already in the endpoint scheme, and the sort of listener inCamelHazelcastListenerType.The constant stays, so nothing stops compiling. The regenerated
hazelcast-multimap.jsonfiles are included.