mateusjunges/laravel-kafka
Laravel Kafka makes it easy to produce and consume Kafka messages in Laravel with a clean, expressive API and improved testability. Build producers and consumers quickly, integrate with your app workflows, and avoid painful Kafka testing setups.
The default Serializer is resolved using the MessageSerializer and MessageDeserializer contracts. Out of the box, the Json serializers are used.
<x-sponsors.request-sponsor/>
To set the default serializer you can bind the MessageSerializer and MessageDeserializer contracts to any class which implements this interfaces.
Open your AppServiceProvider class and add this lines to the register method:
$this->app->bind(\Junges\Kafka\Contracts\MessageSerializer::class, function () {
return new MyCustomSerializer();
});
$this->app->bind(\Junges\Kafka\Contracts\MessageDeserializer::class, function() {
return new MyCustomDeserializer();
});
How can I help you explore Laravel packages today?