You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Bharat Viswanadham (JIRA)" <ji...@apache.org> on 2016/06/16 23:38:05 UTC
[jira] [Commented] (KAFKA-3854) Consecutive regex subscription
calls fail
[ https://issues.apache.org/jira/browse/KAFKA-3854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15334973#comment-15334973 ]
Bharat Viswanadham commented on KAFKA-3854:
-------------------------------------------
Hi Vahid,
Can I take this PR, if you have not started working on this issue.
> Consecutive regex subscription calls fail
> -----------------------------------------
>
> Key: KAFKA-3854
> URL: https://issues.apache.org/jira/browse/KAFKA-3854
> Project: Kafka
> Issue Type: Bug
> Components: consumer
> Reporter: Vahid Hashemian
> Assignee: Vahid Hashemian
>
> When consecutive calls are made to new consumer's [regex subscription|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java#L850], like below:
> {code}
> consumer.subscribe(Pattern.compile("..."), listener);
> consumer.poll(0);
> consumer.subscribe(Pattern.compile("f.."), listener);
> consumer.poll(0);
> {code}
> the second call fails with the following error:
> {code}
> Exception in thread "main" java.lang.IllegalStateException: Subscription to topics, partitions and pattern are mutually exclusive
> at org.apache.kafka.clients.consumer.internals.SubscriptionState.subscribe(SubscriptionState.java:175)
> at org.apache.kafka.clients.consumer.KafkaConsumer.subscribe(KafkaConsumer.java:854)
> at ConsumerSubscriptionSemantics.tryRegexSubscriptionSemantics(ConsumerSubscriptionSemantics.java:76)
> at ConsumerSubscriptionSemantics.main(ConsumerSubscriptionSemantics.java:88)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)