-
Notifications
You must be signed in to change notification settings - Fork 102
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
Key and value serializers for the same topic use the same Glue schema #93
Comments
Do you want to use |
i assume it would be determined the same way as for message values. the important part is that they cant be registered to the same schema as your message keys can (and most likely do) have different schemas |
The only fix for this is to explicitly override the key converter strategy with your own class since no other one exists. Or, just not use structured types for the keys to begin with, e.g stay with numbers or strings Otherwise |
You could use these settings as well to specifically provide a separate schema name for key and value -
|
Why are those not set in the Converter |
We ended up creating a subclass of import com.amazonaws.services.schemaregistry.common.AWSSchemaNamingStrategy
class ConfluentSchemaNamingStrategy extends AWSSchemaNamingStrategy {
override def getSchemaName(transportName: String, data: Any, isKey: Boolean): String = s"$transportName-${if (isKey) "key" else "value"}"
override def getSchemaName(transportName: String): String = s"$transportName-value"
} still feels like a bug that if both your key and value are avro then it will try to register the two schemas under the same one in glue. it's pretty rare that we have a key that is avro but it has happened. |
You also probably need the flexibility to set the registry names for both key and value separately.
|
Note: I'm coming from a world where we use the confluent schema registry so i apologize if i'm misunderstanding something.
Confluent schema registry registers 2 schemas for topics, one for values and one for keys. these schemas are postfixed with
-value
and-key
respectively. It looks like the serializers support this by accepting anisKey
argument. However, when i run my application, they both seem to use the same schema in Glue and the 2nd schema shows up as Failed. Am I doing something wrong or is this a bug?AWSSchemaNamingStrategy.java#L31 seems to be the culprit. one function takes in
isKey
and then drops itThe text was updated successfully, but these errors were encountered: