Skip to content

php-kafka/about

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

PHP Kafka

Description

This is an effort to collect all things related PHP Kafka in one place
and give everybody a better information about what is available in our ecosystem.
If your project is missing, please feel free to create a PR to add it.

Kafka Integration

C binding

librdkafka is a C binding that is used by many
official language bindings of Confluent, e.g. for Go, Python, C#, etc.
It is also used in the extensions and bindings for PHP created by the community.
⚠️ many linux distributions are shipped with a very old version of librdkafka.
In this case it is advisable to build a more recent version manually.

Extensions

arnaud-lb/php-rdkafka

This is a stable extension and its source can be found here.
Its goal is to stay as close as possible to the API of librdafka.
It has a very large spectrum of support, and avoids breaking changes:

  • PHP5 - PHP8
  • librdkafka v0.11.6 - latest

php-kafka/php-simple-kafka-client

This is a new extension, created by a contributor of php-rdkafka. The source can be found here.
Its goal is to reduce complexity of the librdkafka API and to move faster in terms of adoption.
It will only support PHP versions that are not EOL and librdkafka versions that are not outdated (roughly 1year).

FFI binding

idealo/php-rdkafka-ffi

Is an FFI binding that sticks as closely as possibly to the API of php-rdkafka. The source can be found here.
It also offers Admin API (create, alter topics, etc.), which none of the extensions offer so far.

PHP bindings

swoole/phpkafka

New project that is implemented purely in PHP. Its source can be found here

Kafka Schema registry

flix-tech/schema-registry-php-client

Is a REST client to interact with the Kafka schema registry. Its source can be found here

jobcloud/php-kafka-schema-registry-client

Is a REST client to interact with the Kafka schema registry. Its source can be found here

jobcloud/php-console-kafka-schema-registry

Is a project providing symfony console commands to interact with the Kafka schema registry
Useful for CI / CD for schemas. Its source can be found here.

PHP libraries

Description

These libraries use the php extensions and try to make it easier to use the extensions
and give a more fluid interface / simpler usage, etc.

php-enqueue/enqueue-dev

Is a project that supports many messaging / streaming tranpsorts besides Kafka (php-rdkafka).
It integrates easy with Symfony, Laravel, Yii and other PHP framworks / projects. Its source can be found here

jobcloud/php-kafka-lib

Is a very lightweight library, to help use php-rdkafka in an easier and more readable way.
New features of the extension are adopted in a fast manner. Its source can be found here

Visual overview

php-kafka-lib visual overview (credits to @robsontenorio, thank you!)

php-kafka/php-simple-kafka-lib

Is a very lightweight library, to help use php-simple-kafka-client in an easier and more readable way.
New features of the extension are adopted in a fast manner. Its source can be found here
This library is based on the works of jobcloud/php-kafka-lib

Visual overview

php-simple-kafka-lib visual overview

Avro

Description

Avro is a way to define schemas for your messages. This helps improve service communication.
In the strictest form it allows applications not to break as the schemas evolves.
It is highly advised to use schemas for your messages.
You can read more about compatibility here

apache/avro

Official avro support, but no composer integration as of now. The source can be found here

flix-tech/avro-serde-php

Used for serialization / deserialization of avro messages, can be used async.
jobcloud/php-kafka-lib uses this library for Avro support. The source can be found here

wikimedia/avro-php

Fork of the offical apache repository with additional fixes. Its source can be found here

Avro generator / subschema helpers

Description

Avro schemas can get very complex, especially if you have a nested data structure. It is desirable to
seperate these nested structures in sub-schemas. To do this, we need a tool, that will merge a schema
and all its sub schemas into a valid schema.

flix-tech/avro-serde-php

Provides the possibility to create schema with a builder and also to merge schema. Its source can be found here

php-kafka/php-avro-schema-generator

Is a small helper library to create a schema from classes (alpha) and to merge schema.
Its source can be found here

Protobuf

Description

Apache Kafka also supports schema in Protobuf. I have no more info atm, as i am using Avro.
Contributions for projects, etc. are welcome

Code examples (producer / consumer)

php-kafka/php-kafka-examples

Provides examples for extensions in usage with libraries. See examples here

Learning / resources

Providers: Managed Kafka

Releases

No releases published

Sponsor this project

 

Packages

No packages published