Download the PHP package adexos/m2-kafka-connector without Composer
On this page you can find all versions of the php package adexos/m2-kafka-connector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adexos/m2-kafka-connector
More information about adexos/m2-kafka-connector
Files in adexos/m2-kafka-connector
Package m2-kafka-connector
Short Description Kafka module with Avro support
License MIT
Informations about the package m2-kafka-connector
Adexos Kafka Connector
This module is a bridge of koco/messenger-kafka for Magento 2.
It is built to use Magento 2 native queue system with some adjustments to the settings.
It also handles reading with Avro Schemes.
Disclaimer
Only the reading part is done from now. You can't write to a queue.
Installation
Usage
Declare your configuration
To do so, you can simply include in your app/code/Namespace/Module/etc/adminhtml/system.xml
the kafka configuration
form :
Please note the group id
you set, it will be used to connect the queue runner to the Kafka broker
You can find the configuration here : Stores -> Configuration -> Services -> Kafka
Add the queue system
Communication
app/code/Namespace/Module/etc/communication.xml
The request
field will be used as the model of the message you are receiving.
This class must be full typed with PhpDoc because of Magento 2 requirements
Please note that the
topic name
DO NOT HAVE to be the same as the Kafka queue you are looking for. Since most of Kafka queues are in the same broker but have different names depending on the environment, we cannot define them in .xml as we do for other connection types likedb
queuesInstead, the real Kafka topic name must be defined in the system you have set earlier.**
Queue consumer
app/code/Namespace/Module/etc/queue_consumer.xml
queue
: as per Magento doc, it must be identical to the topic name defined in thecommunication.xml
fileconnection
: please note that the Kafka connection must starts withkafka.
, for example :kafka.warehouse
. This is done to detect all kafka connection types and to retrieve them in the configuration defined.
If connection is
kafka.warehouse
, the group id defined in the system.xml file but bewarehouse
. This allow us to map through thecore_config_data
table automatically
handler
: The handler that will take your message and process it. The parameter type must be as same type as the one defined incommunication.xml
inside therequest
field
All versions of m2-kafka-connector with dependencies
php Version ^8.1
flix-tech/avro-serde-php Version ^2.1
koco/messenger-kafka Version ^0.18.0
symfony/serializer Version >=5.4
phpdocumentor/reflection-docblock Version ^5.3