Skip to content

fix: Deny reader creation for partitioned topics#409

Merged
BewareMyPower merged 1 commit intostreamnative:masterfrom
PookieBuns:fix/deny-reader-partitioned-topics
Apr 11, 2026
Merged

fix: Deny reader creation for partitioned topics#409
BewareMyPower merged 1 commit intostreamnative:masterfrom
PookieBuns:fix/deny-reader-partitioned-topics

Conversation

@PookieBuns
Copy link
Copy Markdown
Contributor

Right now during reader creation it validates and deny's multi topics via

if self.topics.unwrap().len() > 1 {

but this catch fails to account for partitioned topics which returns multiple joined_topics. This creates unpredictable behavior at

let (topic, addr) = joined_topics.pop().unwrap();
since it will choose the first partition randomly depending on how its returned by the broker during lookup.

This change changes the validation of topic len on joined_topics.len() instead of self.topics to prevent unpredictable behavior.

If we want to support partitioned topics in pulsar-rs I can draft up a separate PR that internally changes the Reader to hold a InnerConsumer to account for partitioned topics

@PookieBuns PookieBuns force-pushed the fix/deny-reader-partitioned-topics branch from 3a315be to 28d4872 Compare April 10, 2026 22:53
@BewareMyPower BewareMyPower merged commit cf67345 into streamnative:master Apr 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants