Skip to content
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

Closed
nehanarkhede opened this issue Jan 29, 2015 · 6 comments
Closed

KafkaAvroEncoder should support keys #81

nehanarkhede opened this issue Jan 29, 2015 · 6 comments
Assignees

Comments

@nehanarkhede
Copy link
Contributor

@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?

@junrao
Copy link
Contributor

junrao commented Jan 30, 2015

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.

@nehanarkhede
Copy link
Contributor Author

@junrao Overall, that's what I thought. However regarding the following -

(2) for cases when keys are used, they typically use primitive types, (3)

If they use keys with the old producer, the encoder still registers the schema under "subject"-value, which is incorrect

@granders granders assigned granders and junrao and unassigned granders Jan 30, 2015
@junrao
Copy link
Contributor

junrao commented Feb 1, 2015

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.

@nehanarkhede
Copy link
Contributor Author

@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.

@junrao
Copy link
Contributor

junrao commented Feb 3, 2015

Yes, will add this to the documentation.

@junrao
Copy link
Contributor

junrao commented Feb 4, 2015

Updated the doc.

@junrao junrao closed this as completed Feb 4, 2015
aleshchynskyi added a commit to aleshchynskyi/schema-registry that referenced this issue Sep 4, 2019
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants