On the below diagram from the Confluent site we can see that multiple consumer tasks can work on the same thread. My question is that if an application consists of multiple consumers (that can read from different topics) can it happen that some of those consumers would work on a single thread.
I am asking this because I also read that:
You can’t have multiple consumers that belong to the same group in one thread (...)
which would suggest that in general, it is possible for consumers to share a thread, and that if we tried to set the same group to multiple consumers from a single application, it could sometimes not work. And I did observe behaviour that would match it: when I set the same group for all application consumers, only a part of them did work.
The second question is why when I set num.stream.threads to a number greater to the number of consumers it didn't help.
can it happen that some of those consumers would work on a single thread
No. Kafka Streams create threads based on num.stream.threads
config and will create a single KafkaConsumer
per thread.
The second question is why when I set num.stream.threads to a number greater to the number of consumers it didn't help.
What do you mean by "great to the number of consumers". There is no "number-of-consumer" config.