[ https://issues.apache.org/jira/browse/KAFKA-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15150991#comment-15150991 ]
Johan Ström edited comment on KAFKA-1794 at 2/18/16 6:48 AM: ------------------------------------------------------------- Digging up an old but Open ticket. I have a valid use-case for at least allowing access to names(), i.e. the property keys. I've got a Spring Boot adapter which needs to forward configuration information from the Spring Environment (properties). To avoid duplicating every config name in ProducerConfig/ConsumerConfig, I'd like to just get a list of string keys, look for each key in my Environment (under a prefix), and put them into a new Properties object for Kafka to use. By keeping a copy of all option names, I'm getting a lot of extra headache in a) copying this and b) keeping it up to date. My current alternative solution is to access CFG.names() using reflection. Works, but ugly. Proper access to names() would be very nice! was (Author: jstrom): Digging up an old but Open ticket. I have a valid use-case for at least allowing access to names(), i.e. the key properties. I've got a Spring Boot adapter which needs to forward configuration information from the Spring Environment (properties). To avoid duplicating every config name in ProducerConfig/ConsumerConfig, I'd like to just get a list of string keys, look for each key in my Environment (under a prefix), and put them into a new Properties object for Kafka to use. By keeping a copy of all option names, I'm getting a lot of extra headache in a) copying this and b) keeping it up to date. My current alternative solution is to access CFG.names() using reflection. Works, but ugly. Proper access to names() would be very nice! > Make config and config defaults accessible to clients > ----------------------------------------------------- > > Key: KAFKA-1794 > URL: https://issues.apache.org/jira/browse/KAFKA-1794 > Project: Kafka > Issue Type: Bug > Affects Versions: 0.8.1.1 > Reporter: Navina Ramesh > > In the new Kafka producer API, the ProducerConfig is not accessible to the > clients. Samza uses the ProducerConfig instance to access the defaults > property values, which can then be used in the various helper utils. Config > instance is accessible even without instantiating a Kafka producer. > With the new API, there is no way to instantiate a ProducerConfig as the > constructor is marked private. Also, it does not make the default config > values accessible to the client without actually instantiating a > KafkaProducer. > Changes suggested: > 1. Make the ProducerConfig constructor public > 2. Make ConfigDef in ProducerConfig accessible by the client > 3. Use public static variables for kafka config default "values" -- This message was sent by Atlassian JIRA (v6.3.4#6332)