PHPackages                             exoticca/kafka-transport - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. exoticca/kafka-transport

ActiveSymfony-bundle[Queues &amp; Workers](/categories/queues)

exoticca/kafka-transport
========================

A Symfony bundle for integrating Kafka with Messenger

0.1.4(1mo ago)230.4k↓49.4%[4 issues](https://github.com/exoticcaengineering/kafka-transport/issues)MITPHPPHP ^8.3

Since Feb 26Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/exoticcaengineering/kafka-transport)[ Packagist](https://packagist.org/packages/exoticca/kafka-transport)[ RSS](/packages/exoticca-kafka-transport/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (31)Versions (18)Used By (0)

[![exoticcaLogoBlack (1)](https://private-user-images.githubusercontent.com/7015993/417702387-9fd3d1da-34ea-460c-8e7d-3453acb49e89.svg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODI4NDU0NDksIm5iZiI6MTc4Mjg0NTE0OSwicGF0aCI6Ii83MDE1OTkzLzQxNzcwMjM4Ny05ZmQzZDFkYS0zNGVhLTQ2MGMtOGU3ZC0zNDUzYWNiNDllODkuc3ZnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDYzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA2MzBUMTg0NTQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWFmNzI5ZmEyMDk5MDFiNjNmNTVkNzkzMTE4OTM4ZTZjMTBlNDFkNWJmMzQ0NWE2NzJkYWRjYjQ2NDEyOWY5NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGc3ZnJTJCeG1sIn0.BcEiOXXDEwDYr_twMKdRzxzPnLyjgzEU_QHyNBJ5RBE)](https://private-user-images.githubusercontent.com/7015993/417702387-9fd3d1da-34ea-460c-8e7d-3453acb49e89.svg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODI4NDU0NDksIm5iZiI6MTc4Mjg0NTE0OSwicGF0aCI6Ii83MDE1OTkzLzQxNzcwMjM4Ny05ZmQzZDFkYS0zNGVhLTQ2MGMtOGU3ZC0zNDUzYWNiNDllODkuc3ZnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDYzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA2MzBUMTg0NTQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWFmNzI5ZmEyMDk5MDFiNjNmNTVkNzkzMTE4OTM4ZTZjMTBlNDFkNWJmMzQ0NWE2NzJkYWRjYjQ2NDEyOWY5NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGc3ZnJTJCeG1sIn0.BcEiOXXDEwDYr_twMKdRzxzPnLyjgzEU_QHyNBJ5RBE)

Exoticca Kafka Transport Bundle
===============================

[](#exoticca-kafka-transport-bundle)

What is it for?
---------------

[](#what-is-it-for)

The **Exoticca Kafka Messenger Bundle** extends Symfony Messenger's capability to use Kafka as a transport, facilitating integration with event-driven architectures.

---

Motivation
----------

[](#motivation)

Existing solutions to integrate Kafka with Symfony Messenger present limitations when working with complex event architectures. This bundle addresses these issues by offering greater flexibility and traceability in event management.

---

Features
--------

[](#features)

- **Generic Serialization and Deserialization:** Manages the entire message flow using Symfony's serializer.
- **Message Production and Consumption:** Supports both single-topic and multi-topic scenarios, enabling complex event flows.
- **Selective Message Consumption:** Allows consuming only relevant messages for the application while efficiently discarding the rest.
- **Enhanced Traceability:** Supports defining custom headers generically for any message.
- **Optional Schema Validation:** Integrates with *Schema Registry* using Apache Avro, allowing selective validation by transport.
- **Apache Union Schema Compatibility:** Thanks to enhancements on the reference library [avro-php](https://gitlab.com/Jaumo/avro-php).

---

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

[](#installation)

```
composer require exoticca/kafka-transport
```

Add the bundle to the list of bundles in `config/bundles.php`:

```
Exoticca\KafkaMessenger\ExoticcaKafkaBundle::class => ['all' => true],
```

---

Basic Configuration
-------------------

[](#basic-configuration)

Create a configuration file at `config/packages/exoticca_kafka_messenger.yaml` with the minimal setup:

```
exoticca_kafka_messenger:
  identifier:
    staticMethod: 'eventName'
  consumer:
    validate_schema: false
    config:
      group.id: 'group-id'
  producer:
    validate_schema: false
    config: {}
```

### Explanation

[](#explanation)

- `staticMethod`: A static method that returns a string, required in all messages to enable complex Kafka routing.
- `validate_schema`: By default, schema validation against *Schema Registry* is disabled.
- `config`: Allows adding specific Kafka configuration. See the [official documentation](https://github.com/confluentinc/librdkafka/blob/master/CONFIGURATION.md) for more details.

---

Transport Configuration
-----------------------

[](#transport-configuration)

Example of transport configuration in `messenger.yaml`:

```
kafka:
  dsn: '%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_DSN)%'
  options:
    topics: [ 'test_topic' ]
    consumer:
      routing:
        - name: 'test_event'
          class: 'Exoticca\Domain\Event\TestEvent'
      config:
        group.id: 'group-id'

routing:
  'Exoticca\RMS\Domain\Event\TestEvent': kafka
```

Security
--------

[](#security)

You can set your security settings in the bundle configuration.

```
exoticca_kafka_messenger:
  consumer:
    config:
      security.protocol: "%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_SECURITY_PROTOCOL)%"
  producer:
    config:
      security.protocol: "%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_SECURITY_PROTOCOL)%"

when@prod:
  exoticca_kafka_messenger:
    consumer:
      config:
        sasl.mechanisms: "%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_SASL_MECHANISMS)%"
        sasl.username: "%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_SASL_USERNAME)%"
        sasl.password: "%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_SASL_PASSWORD)%"
    producer:
      config:
        sasl.mechanisms: "%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_SASL_MECHANISMS)%"
        sasl.username: "%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_SASL_USERNAME)%"
        sasl.password: "%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_SASL_PASSWORD)%"
```

### Execution

[](#execution)

To consume the message:

```
bin/console messenger:consume kafka -vvv
```

The bundle will automatically deserialize the message.

---

Advanced Usage
--------------

[](#advanced-usage)

### Consume Multiple Message Types from a Single Topic

[](#consume-multiple-message-types-from-a-single-topic)

If a topic contains multiple event types (e.g., `CustomerRegistered`, `CustomerUpdated`, `CustomerDeleted`), you can configure the bundle to consume only the relevant messages and automatically commit the rest.

### Consume from Multiple Topics in a Single Transport

[](#consume-from-multiple-topics-in-a-single-transport)

Example:

```
complex_transport:
  dsn: '%env(KAFKA_EVENTS_MESSENGER_TRANSPORT_DSN)%'
  options:
    topics: ['customers', 'orders']
    consumer:
      config:
        group.id: 'group-id'
      routing:
        - name: 'customer_created'
          class: 'Exoticca\Domain\Customer\Event\CustomerCreated'
        - name: 'order_created'
          class: 'Exoticca\Domain\Order\Event\OrderCreated'
```

---

Acknowledgments
---------------

[](#acknowledgments)

Special thanks to the [avro-php](https://gitlab.com/Jaumo/avro-php) library for facilitating integration with Apache Avro.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance73

Regular maintenance activity

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.4% 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

Every ~35 days

Recently: every ~109 days

Total

14

Last Release

36d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b07d764bb99d4e262ca0c30295c7213c4ac49024d106e4270b91e119e65b6b1?d=identicon)[sysadmin@exoticca.com](/maintainers/sysadmin@exoticca.com)

---

Top Contributors

[![AlvaroRosado](https://avatars.githubusercontent.com/u/7015993?v=4)](https://github.com/AlvaroRosado "AlvaroRosado (19 commits)")[![albertemozo-exoticca](https://avatars.githubusercontent.com/u/165783505?v=4)](https://github.com/albertemozo-exoticca "albertemozo-exoticca (5 commits)")[![marlonsed](https://avatars.githubusercontent.com/u/16228923?v=4)](https://github.com/marlonsed "marlonsed (2 commits)")[![samuelmaudo](https://avatars.githubusercontent.com/u/248153?v=4)](https://github.com/samuelmaudo "samuelmaudo (1 commits)")

---

Tags

symfonybundlequeuetransportMessengerkafka

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/exoticca-kafka-transport/health.svg)

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

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

515100.5k3](/packages/web-auth-webauthn-framework)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)

PHPackages © 2026

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