I'm working with Apache Kafka and its Java client and I see that messages are load balanced across different Kafka Consumers belonging to the same group (i.e. sharing the same group id).
In my application I need all consumers to read all messages.
So I have several questions:
if I don't set any group id in the Consumer Properties, what group id will the Kafka Consumer be given?
Is there a single default value?
Does the client create a random value each time?
Do I need to create a different id for each consumer to be sure that each one receives all messages?
EDIT: Thank you for your answers.
You are correct: if one doesn't set the consumer group id, Kafka should complain.
However, I have found out that if the group id is null, the Java client sets it to the empty string "" to avoid problems. So apparently that is the default value I was looking for.
Surprising all my consumers, even if I don't set their groupIds (and so they are all with groupId == "") seem to receive all the messages the producer writes.
I still can't explain this: any suggestions?