Download the PHP package opennebel/laravel-kafka without Composer
On this page you can find all versions of the php package opennebel/laravel-kafka. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download opennebel/laravel-kafka
More information about opennebel/laravel-kafka
Files in opennebel/laravel-kafka
Download opennebel/laravel-kafka
More information about opennebel/laravel-kafka
Files in opennebel/laravel-kafka
Vendor opennebel
Package laravel-kafka
Short Description A Laravel wrapper around php-rdkafka to produce Kafka messages easily.
License MIT
Homepage https://github.com/opennebel/laravel-kafka
Package laravel-kafka
Short Description A Laravel wrapper around php-rdkafka to produce Kafka messages easily.
License MIT
Homepage https://github.com/opennebel/laravel-kafka
Please rate this library. Is it a good library?
Informations about the package laravel-kafka
Laravel Kafka
Laravel Kafka is a lightweight and expressive library to produce messages to Apache Kafka from your Laravel applications. It is built on top of php-rdkafka and follows Laravel conventions (Service Provider + Facade).
Maintained by OpenNebel
๐ Installation
Make sure the PHP rdkafka
extension is installed:
`
Then install the package via Composer:
โ๏ธ Configuration
Publish the configuration file:
Add the following to your .env
:
๐งช Usage
Basic usage with the Facade
JSON message with structured payload
๐งฉ Dependency injection (instead of Facade)
๐ Additional methods
Method | Description |
---|---|
produce() |
Send a raw message to a given topic |
produceJson() |
Send an array encoded as JSON to a given topic |
produceToDefault() |
Send a raw message to the default topic (from config) |
produceJsonToDefault() |
Send a JSON-encoded message to the default topic |
isConnected() |
Returns true if the producer is initialized |
flush($timeoutMs) |
Manually flush the message queue |
getQueueLength() |
Returns number of messages waiting in the local queue |
getMetadata() |
Returns full Kafka cluster metadata |
ping() |
Returns true if the broker is reachable |
โ๏ธ Example config (config/kafka.php
)
๐ฆ Requirements
- PHP >= 8.0
- Laravel >= 9.x
- Apache Kafka broker required (local or remote)
- Compatible with Docker and production environments
๐ License
MIT ยฉ OpenNebel
All versions of laravel-kafka with dependencies
PHP Build Version
Package Version
The package opennebel/laravel-kafka contains the following files
Loading the files please wait ....