apache kafka streams application num.stream.threads config

Viewed 93

I'm working on a project that's implemented with spring-cloud-stream on top of apache kafka. We are currently tuning the kafka configs to make the application more performant.

One thing I noticed is this num.stream.threads config for the apache streams application. Upon reading the documentation, my understanding for this config is that once this value is set, the streams application will have these number of threads to process the kafka streams.

However when reading the log of the application I saw that these stream threads also assigned to the input topic partitions.

Here are my questions:

  1. If stream threads are responsible for consuming from input topics, we cannot have more stream threads than the total partition number of input topic.
  2. If my assumption for the first question is correct, then what about multiple input topics for one stream application. Let's say we have a stream application that consumes from 2 input topics and produce to 1 output topic. Both input topics were created with 12 partitions. Once I assigned num.stream.threads with 12 threads, then each stream thread consumer will be consuming from 2 partitions, one from each topic right?
0 Answers
Related