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.3(1y ago)224.7k↓17.3%[4 issues](https://github.com/exoticcaengineering/kafka-transport/issues)MITPHPPHP ^8.3

Since Feb 26Pushed 6mo 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 1mo ago

READMEChangelog (10)Dependencies (15)Versions (16)Used By (0)

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

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

35

—

LowBetter than 80% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.2% 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 ~3 days

Total

13

Last Release

413d 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 (2 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

[sylius/sylius

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

8.4k5.6M651](/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)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)[koco/messenger-kafka

Symfony Messenger Kafka Transport

931.1M1](/packages/koco-messenger-kafka)[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)

PHPackages © 2026

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