[
https://issues.apache.org/jira/browse/KAFKA-9170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16972954#comment-16972954
]
Guozhang Wang commented on KAFKA-9170:
--------------------------------------
[~o.muravskiy] Okay I think that's a valid point, but since it impacts on all
config (producer, consumer, admin, streams) objects I think we should consider
fixing all of them together as a KIP since it changes the public behavior a bit
as well. Are you willing to drive on this and propose a KIP to fix all the
config's behavior?
> KafkaStreams constructor fails to read configuration from Properties object
> created with default values
> -------------------------------------------------------------------------------------------------------
>
> Key: KAFKA-9170
> URL: https://issues.apache.org/jira/browse/KAFKA-9170
> Project: Kafka
> Issue Type: Bug
> Components: streams
> Affects Versions: 2.3.0
> Reporter: Oleg Muravskiy
> Priority: Major
>
> When the *Properties* object passed in to the *KafkaStreams* constructor is
> created like
>
> {code:java}
> new Properties(defaultProperties){code}
>
> KafkaStreams fails to read properties properly, which in my case results in
> an error:
>
> {noformat}
> org.apache.kafka.common.config.ConfigException: Missing required
> configuration "bootstrap.servers" which has no default
> value.org.apache.kafka.common.config.ConfigException: Missing required
> configuration "bootstrap.servers" which has no default value. at
> org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:476) at
> org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:466) at
> org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:108)
> at
> org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:142)
> at org.apache.kafka.streams.StreamsConfig.<init>(StreamsConfig.java:844) at
> org.apache.kafka.streams.StreamsConfig.<init>(StreamsConfig.java:839) at
> org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:544)
> {noformat}
> This is due to the fact that the constructor that receives the *Properties*
> class:
>
> {code:java}
> public KafkaStreams(final Topology topology,
> final Properties props) {
> this(topology.internalTopologyBuilder, new StreamsConfig(props), new
> DefaultKafkaClientSupplier());
> {code}
> passes *props* into *StreamsConfig*, which ignores the *Properties*
> interface, and only uses the *Map* interface:
>
> {code:java}
> public StreamsConfig(final Map<?, ?> props) {
> this(props, true);
> }
> {code}
> (Note that if you do
> {{props.getProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG)}}, it returns the
> correct value).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)