PHPackages                             geekcell/kafka-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. geekcell/kafka-bundle

AbandonedArchivedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

geekcell/kafka-bundle
=====================

1.0.1(3y ago)24.0kMITPHPPHP ^8.0

Since Jan 9Pushed 3y ago2 watchersCompare

[ Source](https://github.com/geekcell/kafka-symfony-bundle)[ Packagist](https://packagist.org/packages/geekcell/kafka-bundle)[ RSS](/packages/geekcell-kafka-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

Symfony Bundle for Apache Kafka
===============================

[](#symfony-bundle-for-apache-kafka)

An opinionated Symfony bundle for a painless integration of [Apache Kafka](https://kafka.apache.org/).

Requirements
------------

[](#requirements)

- PHP 8 or higher
- [php-rdkafka](https://github.com/arnaud-lb/php-rdkafka) extension installed
- Apache Kafka broker
- Confluent [Schema Registry](https://github.com/confluentinc/schema-registry) for Kafka

Installation
------------

[](#installation)

To use this bundle, require it in Composer

```
composer require geekcell/kafka-bundle
```

Quickstart
----------

[](#quickstart)

Inherit from `Record` to define records you want to send to Kafka.

```
use GeekCell\KafkaBundle\Record;
use FlixTech\AvroSerializer\Objects\Schema;

class OrderDto extends Record
{
    public int $id;
    public int $productId;
    public int $customerId;
    public int $quantity;
    public float $total;
    public string $status = 'PENDING';

    public function getKey(): ?string
    {
        // Nullable; if provided it will be used as message key
        // to preserve message ordering.
        return sprintf('order_%s', $this->id);
    }

    protected function withFields(RecordType $root): Schema
    {
        // See for examples:
        // https://github.com/flix-tech/avro-serde-php/tree/master/test/Objects/Schema
        $root
            ->field('id', Schema::int())
            ->field('productId', Schema::int())
            ->field('customerId', Schema::int())
            ->field('quantity', Schema::int())
            ->field('total', Schema::float())
            ->field(
                'status',
                Schema::enum()
                    ->name('OrderStatusEnum')
                    ->symbols(...['PENDING', 'PAID', 'SHIPPED', 'CANCELLED'])
                    ->default('PENDING'),
            );

        return $root;
    }
}
```

Create an event, which implements the `Event` contract and returns the above record as *subject*.

```
use GeekCell\KafkaBundle\Contracts\Event;

class OrderPlacedEvent implements Event
{
    public function __construct(
        private OrderDto $orderDto,
    ) {
    }

    public function getSubject(): Record
    {
        return $this->orderDto;
    }
}
```

If you dispatch `Event` via the standard Symfony event dispatcher, it will be automatically be serialized into Avro format, registered, send to Kafka based on your configuration.

```
$this->eventDispatcher->dispatch(new OrderPlacedEvent($orderDto));
```

Bundle Configuration Example
----------------------------

[](#bundle-configuration-example)

```
geek_cell_kafka:
    avro:
        schema_registry_url: 'http://schemaregistry:8081'
        schemas:
            defaults:
                namespace: 'com.acme.avro'
    events:
        lookup: # Look up events in the following directories
            - 'src/Event'

    kafka:
        brokers: 'broker:9091,broker:9092'
        global:
            # Global config params for librdkafka (not pre-validated)
            # https://github.com/confluentinc/librdkafka/blob/master/CONFIGURATION.md#global-configuration-properties
        topic:
            # Topic config params for librdkafka (not pre-validated)
            # https://github.com/confluentinc/librdkafka/blob/master/CONFIGURATION.md#topic-configuration-properties
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1217d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/898471698110cef7b7a749859f26a7e180f2eff02d23765962bbb34d4ad11492?d=identicon)[geekcell](/maintainers/geekcell)

---

Top Contributors

[![b00gizm](https://avatars.githubusercontent.com/u/59077?v=4)](https://github.com/b00gizm "b00gizm (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

apache-kafkaavroavro-schemaavro-schema-registryphpphp8symfonysymfony-bundle

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/geekcell-kafka-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/geekcell-kafka-bundle/health.svg)](https://phpackages.com/packages/geekcell-kafka-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M342](/packages/drupal-core-recommended)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
