Download the PHP package kafka-bus/worker without Composer

On this page you can find all versions of the php package kafka-bus/worker. 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 worker

Kafka Bus Worker

Consumer polling workers for Apache Kafka and PHP. Select topics, configure a consumer group, and dispatch incoming records to Kafka Bus. Workers manage polling and commits; the bus owns routing and handlers.

Installation

Requires PHP 8.2+ and ext-rdkafka. Composer installs Kafka Bus Core.

Quick start

Configure a bus and topic registry first. The complete quick start provides a bootstrap.php returning [$bus, $topics]. With that file in place, save this as consumer.php and run php consumer.php:

The loop keeps listening until stopped or an unhandled error occurs. earliest applies only when no valid committed offset exists for the consumer group.

Commits and errors

Options::autoCommit defaults to false. Automatic offset storage is disabled. Each record is committed synchronously after its dispatcher returns successfully. Handler and commit errors propagate to the caller. A handler skipped by middleware still counts as successful dispatch if no exception is raised.

Partition EOF, transport errors and the supported Kafka timeout codes are ignored by the stream; other consume errors propagate. Handlers should tolerate duplicates. Use a process supervisor to manage failed worker processes.

Set autoCommit: true explicitly to use automatic commits, which may confirm records before processing completes.

Graceful stop

On systems with ext-pcntl, register these handlers before calling run():

forceStop() requests an exit after the current iteration; it does not interrupt a business handler. Create a new runner for a new run after a forced stop.

Merge workers

Register multiple workers, then call create($bus, ['orders-worker', 'payments-worker']). This combines their topics into one polling loop using the first worker's options. Use separate runners or processes for different consumer groups or settings.

Issues and contributions · Releases · MIT License.


All versions of worker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-rdkafka Version *
kafka-bus/core Version ^2.2
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 kafka-bus/worker contains the following files

Loading the files please wait ...