Theoratically speaking, since nodejs is single threaded how can I achieve parallelism when I define multiple consumers to increase throughput?
For eg, If I have a kafka topic that has 4 partitions, on the consumer end how would I be able to consume 4 messages in parallel when used with nodejs. At most I can acheive concurrency using the singe-threaded event loop.
One possible solution would be to fork child processes (in this case 3) so that each process can receive messages from a particular partition assuming the system has 3 idle cores. But how efficient/effective this approach would be?
What would be the best possible way to achieve this?