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

Ashish K Singh commented on KAFKA-2671:
---------------------------------------

Correct me if I am wrong, but below are the options one has to start Kafka 
broker programmatically.

1. Pass a config file and overrides.
2. Start Kafka with KafkaConfig, as suggested by Gwen.

Now, consider a scenario where an application has required Kafka properties 
available in a Properties object. Following are the ways Kafka can be started 
by the app.

1. Create a conf file, and then start Kafka passing the conf file. This seems 
to be an overkill. Passing conf file is ideal while starting from CLI, but I am 
not sure if that is true when one wants to start programmatically.
2. Create a list of overrides and pass that as an argument while starting 
Kafka. Works but is a hack-ish solution.
3. Create KafkaConfig and use that to create Kafka. The app will have to take 
care of starting other entities that {{kafka.Kafka}} starts right now, like, 
metrics reporter, add a shutdown hook, etc. If tomorrow Kafka decides to start 
some other services as well here, application starting Kafka will also have to 
take care of these things.

The interface, suggested in the PR, will enable starting Kafka by just passing 
a Properties object. Unlike, the 3rd option above, this will be future proof 
and app won't have to take care of bunch of other things that {{kafka.Kafka}} 
does right now. I agree that this is not a very hard requirement and one can 
get around with the options suggested above. Its more for programmers 
convenience then anything else, makes Kafka easy to embed in other apps.

> Enable starting Kafka server with a Properties object
> -----------------------------------------------------
>
>                 Key: KAFKA-2671
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2671
>             Project: Kafka
>          Issue Type: Improvement
>          Components: core
>            Reporter: Ashish K Singh
>            Assignee: Ashish K Singh
>
> Kafka, as of now, can only be started with a properties file and override 
> params. It makes life easier for management applications to be able to start 
> Kafka with a properties object programatically.
> The changes required to enable this are minimal, just a tad bit of 
> refactoring of kafka.Kafka. The changes must maintain current behavior intact.



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

Reply via email to