GitHub user lhotari added a comment to the discussion: Whats the right sizing 
of producers & consumers on a partitioned topic with all subscription types ?

There's probably not a definite answer to the right sizing, but I'll try to 
provide some answers to other questions.

The Shared and Key_Shared subscription types implement the competing consumer 
pattern in Pulsar. Multiple consumers use the same subscription name.

In the case of partitioned topics, each partition is independent in the Pulsar 
broker and the aggregation is handled on the client side.
You can use the same subscription types also in that case. 

Client side consumers can consumer from all partitions using the name of the 
partitioned topics, and there's also the possibility to consume from individual 
partitions. The name of the partition for a topic is the topic name appended 
with "-partition-N" where N is 0-based index for the partition.

While each partition is independent on the broker side, there are some small 
details where there are dependencies between the partitions on the client side. 
For producing there is a dependency on the client side such that if the send 
queue for a single partition is full, it will block sending also for other 
partitions. It's reasonable that this happens, but it might become as a 
surprise when doing [failure tests for 
Pulsar](https://streamnative.io/videos/pulsar-summit-san-francisco-2022-tech-deep-dive-validating-apache-pulsars-behavior-under-failure-conditions).
 
Producers can also be created to individual partitions independently and in 
some use cases this might be useful. The Java client also [supports providing a 
MessageRouter 
implementation](https://pulsar.apache.org/docs/3.2.x/concepts-messaging/#routing-modes)
 by the application for choosing the partition for individual messages on a 
partitioned topic producer.






GitHub link: 
https://github.com/apache/pulsar/discussions/22437#discussioncomment-9017251

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to