This repository has PHP examples for Kafka consumers / producers for:
- php-rdkafka: Examples just using the PHP extension
- php-kafka-lib: PHP library that relies on php-rdkafka and supports avro
- php-simple-kafka-client: Examples just using the PHP extension
- php-simple-kafka-lib: PHP library that relies on php-simple-kafka-client and supports avro
Checkout these folders to see how to run the examples:
- Redpanda is a Kafka API compatible streaming platform
If you wan't to test / debug something that is closer to your setup,
you can modify the following arguments in docker-compose.yml
:
PHP_IMAGE_TAG: 8.1-cli-alpine3.15
LIBRDKAFKA_VERSION: v1.8.2
PHP_EXTENSION: php-kafka/php-simple-kafka-client
PHP_EXTENSION_VERSION: v0.1.4
Adjust those, to reflect your setup and afterwards run:
docker-compose up --build -d