You have to read the messages normally and Kafka will batch the messages under the covers automatically. In other words, when the confluent-Kafka-Python client makes a fetch request to the Kafka broker it will often download more than one message (in a batch) and caches it locally on the client side. It will then give them to your consumer in a way that is indistinguishable from non-batched requests.
Hope this will work.
Join our Kafka course online today to become certified expert.