Skip to content

Commit cf67345

Browse files
authored
fix: Deny reader creation for partitioned topics (#409)
1 parent 86fda88 commit cf67345

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/consumer/builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ impl<Exe: Executor> ConsumerBuilder<Exe> {
118118
self
119119
}
120120

121-
/// Interval for refreshing the topics when using a topic regex or when errors occur with a MultiTopicConsumer
121+
/// Interval for refreshing the topics when using a topic regex or when errors occur with a
122+
/// MultiTopicConsumer
122123
#[cfg_attr(feature = "telemetry", tracing::instrument(skip_all))]
123124
pub fn with_topic_refresh(mut self, refresh_interval: Duration) -> Self {
124125
self.topic_refresh = Some(refresh_interval);
@@ -331,9 +332,9 @@ impl<Exe: Executor> ConsumerBuilder<Exe> {
331332
warn!("Subscription Type for a reader is `Exclusive`. Resetting.");
332333
config.sub_type = SubType::Exclusive;
333334

334-
if self.topics.unwrap().len() > 1 {
335+
if joined_topics.len() > 1 {
335336
return Err(Error::Custom(
336-
"Unable to create a reader - one topic max".to_string(),
337+
"Unable to create a reader - one topic partition max".to_string(),
337338
));
338339
}
339340

0 commit comments

Comments
 (0)