[ 
https://issues.apache.org/jira/browse/KAFKA-2388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14695753#comment-14695753
 ] 

Onur Karaman commented on KAFKA-2388:
-------------------------------------

You could take it over if you want.

Sorry, I started working on it but something else took priority. My scrap work 
is here: 
https://github.com/onurkaraman/kafka/commit/0fd461ba3e24d46b3e8f29275d3dbe6c5038c3d8
Feel free to completely throw it away.

I think this ticket is really trying to address two things:
1. distinguishing subscriptions from assignments. This is something that should 
definitely happen.
2. Introduce an onError callback to subscribe(). This one is less clear to me. 
Regardless of what we decide here, we definitely need documentation of 
exceptions in KafkaConsumer.

> subscribe(topic)/unsubscribe(topic) should either take a callback to allow 
> user to handle exceptions or it should be synchronous.
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-2388
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2388
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Jiangjie Qin
>            Assignee: Onur Karaman
>
> According to the mailing list discussion on the consumer interface, we'll 
> replace:
> {code}
> public void subscribe(String... topics);
> public void subscribe(TopicPartition... partitions);
> public Set<TopicPartition> subscriptions();
> {code}
> with:
> {code}
> void subscribe(List<String> topics, RebalanceCallback callback);
> void assign(List<TopicPartition> partitions);
> List<String> subscriptions();
> List<TopicPartition> assignments();
> {code}
> We don't need the unsubscribe APIs anymore.
> The RebalanceCallback would look like:
> {code}
> interface RebalanceCallback {
>   void onAssignment(List<TopicPartition> partitions);
>   void onRevocation(List<TopicPartition> partitions);
>   // handle non-existing topics, etc.
>   void onError(Exception e);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to