Ayush0612005 commented on code in PR #31341:
URL: https://github.com/apache/camel/pull/31341#discussion_r4808942328
##########
components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarConfiguration.java:
##########
@@ -169,11 +170,11 @@ public class PulsarConfiguration implements Cloneable {
description = "The number of threads that receive and process
the messages of each consumer, when "
+ "messageListener is disabled.")
private int numberOfConsumerThreads = 1;
- @UriParam(label = "consumer", enums = "AUTO_SPLIT,STICKY",
+ @UriParam(label = "consumer", enums = "AUTO_SPLIT",
description = "The key shared policy of the consumers, for the
KEY_SHARED subscription type. AUTO_SPLIT has "
- + "the broker split the hash range of the message
keys over the consumers. STICKY needs hash "
- + "ranges assigned to each consumer, which Camel
does not set, so the Pulsar client rejects it and "
- + "the consumer fails to start.")
+ + "the broker split the hash range of the message
keys over the consumers. The STICKY policy of "
+ + "the Pulsar client needs hash ranges assigned to
each consumer, which Camel does not set, so it "
+ + "is not supported.")
Review Comment:
Thanks. I kept the STICKY sentence, as Claus suggests: with STICKY gone from
the enum, it tells users who look for it why it is not offered.
_Claude Code on behalf of Ayush0612005_
##########
components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/utils/consumers/CommonCreationStrategyImpl.java:
##########
@@ -84,11 +84,12 @@ protected static ConsumerBuilder<byte[]> getBuilder(
if (endpointConfiguration.getKeySharedPolicy() != null) {
if
("AUTO_SPLIT".equalsIgnoreCase(endpointConfiguration.getKeySharedPolicy())) {
builder.keySharedPolicy(KeySharedPolicy.autoSplitHashRange());
- } else if
("STICKY".equalsIgnoreCase(endpointConfiguration.getKeySharedPolicy())) {
- builder.keySharedPolicy(KeySharedPolicy.stickyHashRange());
} else {
+ // STICKY needs the hash ranges of each consumer, which Camel
cannot set, so the Pulsar client would
+ // reject it with "Ranges for KeyShared policy must not be
empty"
throw new IllegalArgumentException(
- "Unsupported KeySharedPolicy: " +
endpointConfiguration.getKeySharedPolicy());
+ "Unsupported keySharedPolicy: " +
endpointConfiguration.getKeySharedPolicy()
Review Comment:
The message already says that only AUTO_SPLIT is supported, and the comment
at the `throw` explains why STICKY needs hash ranges, so I kept the message
short.
_Claude Code on behalf of Ayush0612005_
--
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]