You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Jakub Scholz <ja...@scholz.cz> on 2017/09/13 21:13:33 UTC

Is ConsumerConfig class supposed to contain all config options?

Hi,

When going through the Kafka client examples I noticed in the Consumer
example (
https://github.com/apache/kafka/blob/trunk/examples/src/main/java/kafka/examples/Consumer.java)
that it is using class ConsumerConfig instead of specifying the
configuration keys manually (e.g. ConsumerConfig.GROUP_ID_CONFIG instead of
"group.id). From this example code I though that the purpose of the
ConsumerConfig and ProducerConfig classes is to make it easier to configure
the clients and used it like that.

But then I was looking for some SSL options and realised that these two
classes do not contain all configuration options. All the SSL and SASL
options are in SslConfigs and SaslConfigs. Some other options are also in
CommonConfig. But it looks like the keys for some options from CommonConfig
are also partially mirrored in ConsumerConfig and ProducerConfig (e.g.
BOOTSTRAP_SERVERS_CONFIG). This seems a bit confusing for me as a
developer. I know that the documentation on web lists all the options. But
I thought it would be nice to have this easily available also from the IDE.

So I'm a bit wondering ... what is the purpose of the ProducerConfig and
ConsumerConfig class? IMHO it should either:
- contain all the client options so that it can be used for everything
(i.e. it should link all options from CommonConfig, SslConfig etc.)
     or:
- it should not be used in the examples to not mislead anyone that this is
a helper class with all options.

Either case, I would gladly raise JIRA and PR for this. So please let me
know what do you think about it.

Thanks & Regards
Jakub