Maybe it could of interest for users as well.

Paolo Patierno
Senior Software Engineer (IoT) @ Red Hat
Microsoft MVP on Windows Embedded & IoT
Microsoft Azure Advisor

Twitter : @ppatierno<http://twitter.com/ppatierno>
Linkedin : paolopatierno<http://it.linkedin.com/in/paolopatierno>
Blog : DevExperience<http://paolopatierno.wordpress.com/>


________________________________
From: Paolo Patierno <ppatie...@live.com>
Sent: Wednesday, September 13, 2017 11:40 AM
To: d...@kafka.apache.org
Subject: Admin Client : no way to create topic with default partitions and 
replication factor

Hi devs,


taking a look at the Admin Client API and the related implementation it seems 
that :


  *   the CreateTopics request allows you to have "num_partitions" and 
"replication_factor" with -1 as value (it means unset) which is used when you 
specify the "replica_assignment" instead
  *   the NewTopic available constructor doesn't allow you to use such a 
feature. Even trying to pass null as "replicaAssignments" throws an exception 
because a collection is built there.

I think that it could be useful from an administrative point of view having 
this possibility as it already happens when you have auto creation enabled and 
a topic is created with default partitions and replicas when a 
consumer/producer asks for metadata (and the topic doesn't exist).


Of course this proposal needs a KIP because we are changing the Admin Client 
API (but not breaking). Other than a change in the admin client side it will 
need a change in the broker as well because the current path (when a create 
topic request comes) doesn't handle the -1 values for "num_partitions" and 
"replication_factor", so it needs to set default values in this case.


What do you think about that ?


Thanks.


Paolo Patierno
Senior Software Engineer (IoT) @ Red Hat
Microsoft MVP on Windows Embedded & IoT
Microsoft Azure Advisor

Twitter : @ppatierno<http://twitter.com/ppatierno>
Linkedin : paolopatierno<http://it.linkedin.com/in/paolopatierno>
Blog : DevExperience<http://paolopatierno.wordpress.com/>

Reply via email to