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.
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.
In this case it is advisable to build a more recent version manually.
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
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).
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.
New project that is implemented purely in PHP. Its source can be found here
Is a REST client to interact with the Kafka schema registry. Its source can be found here
Is a REST client to interact with the Kafka schema registry. Its source can be found here
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.
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.
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
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
(credits to @robsontenorio, thank you!)
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
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
Official avro support, but no composer integration as of now. The source can be found here
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
Fork of the offical apache repository with additional fixes. Its source can be found here
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.
Provides the possibility to create schema with a builder and also to merge schema. Its source can be found here
Is a small helper library to create a schema from classes (alpha) and to merge schema.
Its source can be found here
Apache Kafka also supports schema in Protobuf. I have no more info atm, as i am using Avro.
Contributions for projects, etc. are welcome
Provides examples for extensions in usage with libraries. See examples here
- Confluent blog has a lot of good articles
- Enterprise integration patterns a fantastic book that is still very relevant
- Designing event driven systems
- Kafka the definitive guide deep dive into Apache Kafka
- Microservices and Kafka input on system architecture