This is the documentation for
v1.7 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
Producing message batch to kafka
You can publish multiple messages at the same time by using message batches.
To use a message batch, you must create a Junges\Kafka\Producers\MessageBatch instance.
Then create as many messages as you want and push them to the MesageBatch instance.
Finally, create your producer and call the sendBatch, passing the MessageBatch instance as a parameter.
This is helpful when you persist messages in storage before publishing (e.g. TransactionalOutbox Pattern).