This message was deleted.
# general
s
This message was deleted.
e
it is still 1 consumer per partition
it is the meaning of “Exclusive”
maybe the wording is not accurate
g
yes, the wording is misleading. one would assume that a single consumer in the single subscription would now consume from all the partitions.
I suggest this text - "Note that if the topic is partitioned, each partition would be consumed by one individual consumer connected to the subscription i.e. N total consumers for the partitioned topic where N is the partition count"
p
@Girish Sharma We haven't changed the behavior in 3.0. If you subscribe to a partitioned topic, the working is correct because the first will subscribe to all the partitions of the partitioned topic. If you want to use N consumer to consume N partitions, you need to subscribe to individual partitions, as consumer-0 subscribes to partition-0, and consumer-1 subscribes to partition-1... So, the wording is correct, and it would be great to add more context about subscribing to individual partitions of the exclusive subscription.
👍 1
g
@Penghui even in that case, there are still N consumers created (consumer id 0 through N-1) .. so while logically the first consumer object would subscribe to all partitions, technically, there are still N consumers 🙂
And yes, like other types have partitioned topic section, exclusive would also benefit from that section where a couple strategies to subscribe from a partitioned topic via exclusive sub could be mentioned
p
Only consumer id 0 can subscribe to the partitioned topic successfully. Others will get failed. From the user's perspective, only one consumer was created successfully. But in the client internals, it actually created N consumer instances, it's implementation details, not for users.
g
but it gives false impression to users. users of the doc are very technical. We are facing this issue every day internally here 🙂. People avoid using exclusive sub because they think only 1 consumer would consume from all partitions and that there is no other way.. While that's not the case even in the single consumer object approach.
Copy code
2023-05-08 13:50:11.570 INFO  [pulsar-client-io-1-1] pulsar.client.impl.ConsumerImpl - [<persistent://test/validate/kpa-test-partition-2][test/sub-test>] Subscribed to topic on /10.xx.xx.xxx:6650 -- consumer: 2
2023-05-08 13:50:11.570 INFO  [pulsar-client-io-1-1] pulsar.client.impl.ConsumerImpl - [<persistent://test/validate/kpa-test-partition-3][test/sub-test>] Subscribed to topic on /10.xx.xx.xxx:6650 -- consumer: 3
2023-05-08 13:50:11.570 INFO  [pulsar-client-io-1-1] pulsar.client.impl.ConsumerImpl - [<persistent://test/validate/kpa-test-partition-0][test/sub-test>] Subscribed to topic on /10.xx.xx.xxx:6650 -- consumer: 0
2023-05-08 13:50:11.570 INFO  [pulsar-client-io-1-1] pulsar.client.impl.ConsumerImpl - [<persistent://test/validate/kpa-test-partition-1][test/sub-test>] Subscribed to topic on /10.xx.xx.xxx:6650 -- consumer: 1