Farfetch/kafkaflow

[Bug Report]: IMessageSerializer interface doesn't exist in KafkaFlow.Abstractions

Closed this issue · 1 comments

Prerequisites

  • I have searched issues to ensure it has not already been reported

Description

I've been following the docs while implementing serializers.

On the website it says:

services.AddKafka(kafka => kafka
    .AddCluster(cluster => cluster
        .WithBrokers(new[] { "localhost:9092" })
        .AddProducer<ProductEventsProducer>(producer => producer
            ...
            .AddMiddlewares(middlewares => middleware
                ...
                .AddSerializer<JsonMessageSerializer>() // Using the DefaultMessageTypeResolver (**I'M USING THIS ONE**)
                // or
                .AddSerializer<JsonMessageSerializer, YourTypeResolver>()
                // or
                .AddSerializer(
                    resolver => new JsonMessageSerializer(...),
                    resolver => new YourTypeResolver(...))
                // or
                .AddSingleTypeSerializer<JsonMessageSerializer, YourMessageType>()
                // or
                .AddSingleTypeSerializer<YourMessageType>(resolver => new JsonMessageSerializer(...))
                ...
            )
        )
    )
);

But, for some reason I get an error that says:

Reference to type 'IMessageSerializer' claims it is defined in 'KafkaFlow.Abstractions', but it could not be found

I checked in this repository in the nuget KafkaFlow.Abstractions and I see that the IMessageSerializer interface just doesn't exist there...

What should I do?

Steps to reproduce

  1. In the AddMiddlewares section try to add AddSerializer
  2. Add JsonMessageSerializer that implements IMessageSerializer

Expected behavior

The IMessageSerializer should be present in the KafkaFlow.Abstractions nuget package.

Actual behavior

IMessageSerializer doesn't exist in the KafkaFlow.Abstractions nuget.

KafkaFlow version

2.2.16

Hi, @bornahrastovec,
We suggest you update to version 3, where IMessageSerializer was replaced by ISerializer/IDeserializer and is part of KafkaFlow.Abstractions. You shouldn't experience that issue then, but let us know if that happens.