Yes, this has been an issue for some time. The problem is that the AdminUtils requires this info to be known client side, but there is no API to get it. I think things will be better in 0.11.0 where we have the AdminClient that includes support for both topic CRUD APIs (not just ZK modifications like AdminUtils does) and APIs to get configs. But as far as I'm aware it will still be 2 calls (1 to get the default configs, another to create the topics with those configs).
-Tommy ________________________________________ From: Jeff Widman [j...@netskope.com] Sent: Thursday, May 11, 2017 7:42 PM To: users@kafka.apache.org Subject: Re: Why do I need to specify replication factor when creating a topic? To further clarify: I'm trying to create topics programmatically. We want to run our code against dev/staging/production clusters. In dev, they are often single-broker clusters. In production, we default to replication factor of 3. So that's why it'd make life easier if it defaulted to the value in server.properties, rather than our code having to figure out whether it's a dev vs produciton cluster. I'm aware we could hack around this by relying on topic auto-creation, but we'd rather disable that to prevent topics being accidentally created. On Thu, May 11, 2017 at 4:07 PM, Jeff Widman <j...@netskope.com> wrote: > When creating a new topic, why do I need to specify the replication factor > and number of partitions? > > I'd rather than when omitted, Kafka defaults to the value set in > server.properties. > > Was this an explicit design decision? > ________________________________ This email and any attachments may contain confidential and privileged material for the sole use of the intended recipient. Any review, copying, or distribution of this email (or any attachments) by others is prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete this email and any attachments. No employee or agent of TiVo Inc. is authorized to conclude any binding agreement on behalf of TiVo Inc. by email. Binding agreements with TiVo Inc. may only be made by a signed written agreement.