Claus Ibsen created CAMEL-27935:
-----------------------------------

             Summary: camel-hazelcast: an Integer TTL header fails, an unknown 
hazelcastInstanceName is ignored, queue poolSize has no effect
                 Key: CAMEL-27935
                 URL: https://issues.apache.org/jira/browse/CAMEL-27935
             Project: Camel
          Issue Type: Bug
          Components: camel-hazelcast
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-hazelcast for 
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31191).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. An Integer TTL header fails with ClassCastException
{{HazelcastMapProducer}} put and putIfAbsent cast CamelHazelcastObjectTtlValue 
to Long, so an Integer value (the javaType the header metadata declares) throws 
ClassCastException. A unit without a value gives a NullPointerException, and a 
value without a unit fails in IMap.put with "null timeunit".
Proposed change: read the header with getHeader(TTL_VALUE, Long.class), fail 
with a clear message when only one of the two headers is set, and declare the 
header as Long.

h4. 2. An unknown hazelcastInstanceName is ignored
{{HazelcastDefaultComponent}} getOrCreateHzInstance / 
getOrCreateHzClientInstance: when Hazelcast.getHazelcastInstanceByName returns 
null, the endpoint silently uses the component instance or starts a new member 
or client with the default configuration, so a typo creates a separate cluster 
member.
Proposed change: throw IllegalArgumentException when the named instance is not 
found.

h4. 3. poolSize > 1 has no effect for the queue consumer in poll mode
{{HazelcastQueueConsumer.doStart}} creates a fixed pool of poolSize threads but 
submits a single QueueConsumerTask.
Proposed change: submit poolSize tasks, or deprecate the option.

h4. 4. A poll timeout of 0 or less makes the poll loop spin
{{HazelcastQueueConsumer}} (poll mode, pollingTimeout) and 
{{HazelcastSedaConsumer}} (pollTimeout): poll(0) returns at once, so on an 
empty queue the loop calls the cluster without pause.
Proposed change: reject values <= 0, or use a minimum wait.

h4. 5. Smaller issues
CamelHazelcastObjectId lists hazelcast-list, -queue, -set and -topic in 
applicableFor, but only map, multimap and replicatedmap use it. hazelcastConfig 
and operation (an alias of defaultOperation) are accepted by createEndpoint but 
are not @UriParam, so they are missing from the catalog. defaultOperation has 
no default in the metadata, but hazelcast-queue defaults to add and 
hazelcast-topic to publish. hazelcastMode is a free String (only "node" is 
checked) and could be an enum. cacheName is required for hazelcast-instance, 
which ignores it. HazelcastConstants.ITEM_LISTENER is never used.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to