I am writing a simple Kafka consumer in java, which is configured to read from multiple topics. currently, let's assume two topics ( topic1 and topic 2) and single partition for both topics.
What is the order in which Kafka consumer reads from the topic1 and topic2. If both the topic have let's say 100 messages already published.
Let'say topic1 has the following messages ( A1, A2, A3,......A100) in time ordered fashion.
Let'say topic2 has the following messages ( B1, B2, B3,......B100) in time ordered fashion.
What will be the order of the message received from the topics,
- The consumer reads all message from topic1 first followed by topic2?
- The consumer reads in time order fashion mixing the messages from both the topics?
I read the Kafka documentation could not find the reference on this. Any help is much appreciated.