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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-kafka

LaravelKafka

LaravelKafka is a simple yet powerful library for producing messages to Apache Kafka from your Laravel applications. It builds upon php-rdkafka and adheres to Laravel conventions, including Service Providers, Facades, Queueable Jobs, Artisan commands, dependency injection, and configuration.

๐Ÿ”ง Maintained by OpenNebel


๐Ÿงฉ Features


๐Ÿš€ Installation

1. Install the PHP Kafka extension

๐Ÿ“Œ Ensure php.ini loads the extension: extension=rdkafka

2. Install the library


โš™๏ธ Configuration

Method 1 โ€“ Full Publication (config + migration)

Method 2 โ€“ Separate Publication

.env File


โœ‰๏ธ Sending Messages

๐Ÿ”น Synchronous Sending

๐Ÿ”ธ Asynchronous Sending (Laravel Queue)

Start the worker to process jobs:


๐Ÿงฉ Usage with Dependency Injection


๐Ÿ’ฅ Error Handling (DLQ)

If flush() fails or the broker is unreachable, the message is:

Migration:

Retry Failed Messages:


๐Ÿ›  Artisan Commands

Command Description
kafka:status Checks Kafka broker connectivity and lists metadata
kafka:retry-failed Retries messages in the DLQ

These commands are auto-registered via KafkaServiceProvider.


๐Ÿงฐ Service API

Method Description
produce() Raw string to topic with optional headers/key/partition/msgflags
produceJson() JSON payload to topic
produceToDefault() Raw string to default topic
produceJsonToDefault() JSON payload to default topic
produceAsync() Dispatch async job to a topic
produceAsyncToDefault() Dispatch async job to default topic
flush($timeoutMs) Flush local queue to Kafka broker
getQueueLength() Messages in local Kafka buffer
ping() Kafka connection test
getMetadata() Cluster info: topics, partitions, brokers
isConnected() Indicates producer was created correctly

๐Ÿ“‚ Configuration (config/kafka.php)


โœ… Prerequisites


๐Ÿง  Recommendations


๐Ÿ“„ License

MIT ยฉ OpenNebel


All versions of laravel-kafka with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-rdkafka Version *
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package opennebel/laravel-kafka contains the following files

Loading the files please wait ....