You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/30 16:47:29 UTC

[GitHub] [pulsar] zbentley commented on issue #15399: Does plusar support key-shared producer?

zbentley commented on issue #15399:
URL: https://github.com/apache/pulsar/issues/15399#issuecomment-1114018049

   I'm not quite sure what you're asking. 
   
   If you mean "can I produce messages with common keys in a topic such that they are delivered in order", then yes; if you use a key-based batcher for your producer and publish multiple messages with the same key, they will be delivered in order to a single [KeyShared consumer](https://pulsar.apache.org/docs/en/concepts-messaging/#key_shared). 
   
   If you mean "can I speed up the publication of messages with a common key in a topic by removing the need that messages with a key be causally ordered with all other messages in the topic", then yes, but it isn't due to key-shared behavior exclusively. There are two mechanisms to improve the performance of keyed messages (while retaining order for KeyShared consumers): topic partitioning, and batching. Increasing the partition count of your topic and/or increasing the batch/flush size of your producer will improve throughput (assuming your bottleneck was publication to a single topic and not something else, like a contended bookie handling other topics' work). That throughput improvement will happen regardless of whether or not you are using key-shared behavior, and will always compromise strict ordering unless a key-based batcher is used. If a key-based batcher is used, the likelihood of different keys going to different partitions (and being batched and flushed in separate threa
 ds/connections inside the client) is high but not 100%. Using a different partition and a different client connection/IO thread improves performance.
   
   Does that help, or was your question about something else?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org