Claus Ibsen created CAMEL-27940:
-----------------------------------
Summary: camel-pulsar: batchingMaxMessages is not used, STICKY
key-shared policy cannot start, the endpoint client is never closed
Key: CAMEL-27940
URL: https://issues.apache.org/jira/browse/CAMEL-27940
Project: Camel
Issue Type: Bug
Components: camel-pulsar
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-pulsar 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. batchingMaxMessages is not used
{{PulsarProducer.createProducer}} calls
.batchingMaxMessages(configuration.getMaxPendingMessages()), so the
batchingMaxMessages option is ignored (both default to 1000). The description
says so for now.
Proposed change: pass configuration.getBatchingMaxMessages().
h4. 2. keySharedPolicy=STICKY can never start
{{CommonCreationStrategyImpl.getBuilder}} calls
KeySharedPolicy.stickyHashRange() without ranges;
ConsumerBuilderImpl.keySharedPolicy() validates it and throws
IllegalArgumentException("Ranges for KeyShared policy must not be empty.").
Proposed change: drop STICKY from the enum, or add an option for the hash
ranges.
h4. 3. The PulsarClient created by the endpoint is never closed
{{PulsarEndpoint.doStart}} builds a PulsarClient when none is given, and
neither the endpoint nor the component closes it, so its threads and broker
connections stay after the endpoint is stopped or its route removed.
Proposed change: remember that the endpoint created it and close it in
doShutdown (or doStop).
h4. 4. Options passed always make producer creation fail
{{PulsarProducer.createProducer}} always passes
maxPendingMessagesAcrossPartitions (default 50000) and
batchingMaxPublishDelayMicros, so maxPendingMessages > 50000 without raising
maxPendingMessagesAcrossPartitions fails ("needs to be >= maxPendingMessages"),
and a batching delay below 1000 microseconds fails even with batching disabled.
Proposed change: pass them only when batching is enabled, or derive
acrossPartitions from max(..., maxPendingMessages).
h4. 5. Smaller issues
authenticationParams usually holds a credential but is not marked secret =
true. maxPendingMessagesAcrossPartitions is @Deprecated without a
deprecationNote. enableRetry is of little use from Camel, as the consumer never
calls reconsumeLater.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)