I have 22 topics and ordering within a topic is important to me. I do not have any partitions.
Basically I have 11 tenants and I need two topics per tenant.
I am confused about whether to have a single consumer group for all 22 topics or have 22 consumer groups?
The load is not much and the consumption is not real-time, it is an offline process, so a lag of a few millis won't hurt.
I am confused about the following points:
1. If I have one consumer group with one consumer running on a single machine (JVM - Spring Boot Application), will the consumer work with all topics using a single thread or will there be separate thread per topic? If it is a single thread, the thread may get overloaded. If there are multiple threads, I will be able to achieve parallelism(utilize all the cores) without spinning another machine.
2. If I have one consumer group listening to all topics with multiple consumers running on multiple machines (Multiple JVMs - Spring Boot Application), will the Zookeeper distribute the load from different topics to different machines? I understand that messages from one topic will always go to a single machine.
For eg: If there are 2 consumers (one per machine), a single consumer group listening to all the 22 topics, and if the 22 topics produce messages simultaneously, will they be distributed among the 2 machines maybe something like messages from topic 1-11 goes to machine one and from topic 12-22 goes to machine two? I am just interested in load distribution.
Does it work this way (assuming equal load from all topics)?
2 machines -> messages from approx 11 topics per machine
4 machines -> messages from approx 5 topics per machine and so on.