Search code examples
apache-kafkakafka-producer-apiapache-kafka-streams

With KStream implementation, should I set ProducerConfig or StreamsConfig settings?


I have a KStream implementation and I see that both ProducerConfig and StreamsConfig have similar settings such as REQUEST_TIMEOUT_MS_CONFIG.

Should I set both?
If not, which one?


Solution

  • They both evaluate to the same thing (along with the ConsumerConfig property). If you set both, the later one overwrites the first since that's how Java Maps & Properties work.

    Its generally easier to read your code if you stick with StreamsConfig constants when writing Kafka Streams jobs