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
If your application needs to read messages from a Kafka topic, you must create a consumer object, subscribe to the appropriate topic and start receiving messages.
To create a consumer using this package you can use the
createConsumer method, on Kafka facade:
$consumer = Kafka::createConsumer();
This method also allows you to specify the
topics it should consume, the
broker and the consumer
$consumer = Kafka::createConsumer(['topic-1', 'topic-2'], 'group-id', 'broker');
This method returns a
Junges\Kafka\Consumers\ConsumerBuilder::class instance, and you can use it to configure your consumer.