Here are a few of the common message consuming patterns:
- Consumer group - continuous data processing: In this pattern, once consumer is created and subscribes to a topic, it starts receiving messages from the current offset. The consumer commits the latest offsets based on the count of messages received in a batch at a regular, configured interval. The consumer checks whether it's time to commit, and if it is, it will commit the offsets. Offset commit can happen synchronously or asynchronously. It uses the auto-commit feature of the consumer API.
The key point to understand in this pattern is that consumer is not controlling the message flows. It is driven by the current offset of the partition in a consumer group. It receives messages from that current offset and commits the offsets as and when messages are received by it after regular...