This is the documentation for
v1.12 but the latest version is
You can switch versions in the menu on the left/at the top.
Check your current version with the following command:
composer show mateusjunges/laravel-kafka
Handling message batch
If you want to handle multiple messages at once, you can build your consumer enabling batch settings.
The enableBatching method enables the batching feature, and you can use withBatchSizeLimit to set the maximum size of a batch.
The withBatchReleaseInterval sets the interval in which the batch of messages will be released after timer exceeds given interval.
The example below shows that batch is going to be handled if batch size is greater or equals to 1000 or every 1500 milliseconds.
Batching feature could be helpful when you work with databases like ClickHouse, where you insert data in large batches.