[ https://issues.apache.org/jira/browse/KAFKA-2350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14639746#comment-14639746 ]
Jiangjie Qin commented on KAFKA-2350: ------------------------------------- [~guozhang], my understanding is that pause/unpause will also need to do the call trace, right? Otherwise if user are not using consumer coordinator, what would pause/unpause do for them? Is that exactly the same as subscribe/unsubscribe at partition level? Also, we have to do sub/unsub call trace anyway, otherwise, how can we enforce mutual exclusion of auto/manual partition assignment mode? In terms of rebalance issue. Do you mean we can avoid the issue with pause/unpause? I see the same issue. Consider the following: {code} subscribe(topicA); // then say assignment() return me topicA-partition1. poll(); // Say partition has been assigned to other consumer pause(topicA-partition1); // Should we throw exception? unpause(topicA-partition1); // Should we throw exception here? {code} > Add KafkaConsumer pause capability > ---------------------------------- > > Key: KAFKA-2350 > URL: https://issues.apache.org/jira/browse/KAFKA-2350 > Project: Kafka > Issue Type: Improvement > Reporter: Jason Gustafson > Assignee: Jason Gustafson > > There are some use cases in stream processing where it is helpful to be able > to pause consumption of a topic. For example, when joining two topics, you > may need to delay processing of one topic while you wait for the consumer of > the other topic to catch up. The new consumer currently doesn't provide a > nice way to do this. If you skip poll() or if you unsubscribe, then a > rebalance will be triggered and your partitions will be reassigned. > One way to achieve this would be to add two new methods to KafkaConsumer: > {code} > void pause(String... topics); > void unpause(String... topics); > {code} > When a topic is paused, a call to KafkaConsumer.poll will not initiate any > new fetches for that topic. After it is unpaused, fetches will begin again. -- This message was sent by Atlassian JIRA (v6.3.4#6332)