Skip to content

Explicitly producing/consuming to/from a specific topic partition #24127

Answered by lhotari
SantanuKar43 asked this question in Q&A
Discussion options

You must be logged in to vote

Pulsar allows direct partition access (via -partition-[n] suffix) because of how it's architected internally. Under the hood, partitioned topics are actually separate non-partitioned topics with a naming convention. On the broker side, the partitioned topic itself is only metadata about how many partitions there are in total.

This gives developers flexibility for advanced scenarios but doesn't mean you should always use it. For most use cases, you're better off using the higher-level abstractions provided by the client libraries.

The client handles partition management internally through components like MultiTopicsConsumerImpl and PartitionedProducerImpl, so you typically don't need to wo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SantanuKar43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants