Dhairya-007 opened a new pull request, #29959:
URL: https://github.com/apache/camel/pull/29959
## Problem
`HazelcastConstants` documents a header for the multimap endpoint, right
beside `CamelHazelcastCacheName`:
```java
@Metadata(label = "consumer", description = "The name of the cache - e.g.
\"foo\"", javaType = "String", applicableFor = {
SCHEME_MULTIMAP, SCHEME_REPLICATED_MAP, SCHEME_LIST, SCHEME_QUEUE,
SCHEME_SET, SCHEME_MAP, SCHEME_TOPIC })
public static final String CACHE_NAME = "CamelHazelcastCacheName";
@Metadata(description = "The type of the cache - here multimap", javaType =
"String", applicableFor = SCHEME_MULTIMAP)
public static final String CACHE_TYPE = "CamelHazelcastCacheType";
```
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:
```java
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());
}
```
No producer reads it either - `CamelHazelcastCacheType` appears 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 a `label` nor any
code behind it.
## Fix
Deprecate the constant with a `deprecationNote` saying what the listener
does set, so the catalog stops listing it for `hazelcast-multimap`. The kind of
cache is already in the endpoint scheme, and the sort of listener in
`CamelHazelcastListenerType`.
The constant stays, so nothing stops compiling. The regenerated
`hazelcast-multimap.json` files are included.
--
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]