-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KafkaAvroEncoder should support keys #81
Comments
This is for the old producer. You can't just add a config since the same serializer class will be used for both key and value and you don't know which config is for which. We can potentially duplicate the code to two classes, one called KeyAvroSerializer and the other called ValueAvroSerializer. However, it's a bit confusing. Since (1) most use cases don't use key, (2) for cases when keys are used, they typically use primitive types, (3) we encourage people to use the new producer, we can just say, in the old producer, AvorSerializer should only by used for value. If key is used, use a primitive type such as int and string. |
@junrao Overall, that's what I thought. However regarding the following -
If they use keys with the old producer, the encoder still registers the schema under "subject"-value, which is incorrect |
If they want to use keys in the old producer, they will just specify a primitive type encoder that won't go through schema registration. |
@junrao I see, so we should cover this in the schema registry user documentation. I will keep this open so the patch can at least modify https://github.com/confluentinc/docs to include instructions for users of the old and new producer on usage of avro-serializers. |
Yes, will add this to the documentation. |
Updated the doc. |
…apR-FS (confluentinc#81) * Refactor UrlUtils to prevent NullPointerException * Handle NullPointerException when getting Zookeeper URL from MapR-FS for SR Core * Refactor getting SR URL from MapR-FS for SR Client
@Ishiihara @junrao Is there a reason we left out keys from the serializer patch? Shouldn't the serializer take in a config that specifies whether it is a key serializer or a value serializer?
The text was updated successfully, but these errors were encountered: