This is the documentation for
v1.11 but the latest version is
v1.13
.
You can switch versions in the menu on the left/at the top.
Check your current version with the following command:
composer show mateusjunges/laravel-kafka
The default Serializer is resolved using the MessageSerializer
and MessageDeserializer
contracts. Out of the box, the Json
serializers are used.
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();
});