Download the PHP package exoticca/kafka-transport without Composer
On this page you can find all versions of the php package exoticca/kafka-transport. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package kafka-transport
Exoticca Kafka Transport Bundle
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
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
- 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.
Installation
Add the bundle to the list of bundles in config/bundles.php
:
Basic Configuration
Create a configuration file at config/packages/exoticca_kafka_messenger.yaml
with the minimal setup:
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 for more details.
Transport Configuration
Example of transport configuration in messenger.yaml
:
Execution
To consume the message:
The bundle will automatically deserialize the message.
Advanced Usage
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
Example:
Acknowledgments
Special thanks to the avro-php library for facilitating integration with Apache Avro.
All versions of kafka-transport with dependencies
ext-json Version *
ext-rdkafka Version *
jaumo/avro Version ^3.0
phpdocumentor/reflection-docblock Version ^5.0
psr/log Version ^1.1 || ^2.0 || ^3.0
symfony/config Version ^6.0||7.*
symfony/dependency-injection Version ^6.0||7.*
symfony/http-client Version ^6.0||7.*
symfony/http-kernel Version ^6.0||7.*
symfony/messenger Version ^6.0||7.*
symfony/property-access Version ^6.0||7.*
symfony/property-info Version ^6.0||7.*
symfony/serializer Version ^6.0 || ^7.0