[ https://issues.apache.org/jira/browse/KAFKA-9559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17311954#comment-17311954 ]
A. Sophie Blee-Goldman commented on KAFKA-9559: ----------------------------------------------- I don't think we can just throw an exception based on whether `defaultKeySerde` is null, as we _always_ pass this in to initialize the keySerde in AbstractProcessorContext. Then we have about a million (ok, like 30) places where we call AbstractProcessorContext#key/valueSerde to get the default, and then maybe do/don't actually use that default serde by checking whether the operator/whatever has configured a specific serde. So we couldn't just throw an exception on null inside StreamsConfig#defaultKey/ValueSerde, and we can't throw if null inside AbstractProcessorContext#key/valueSerde without doing some refactoring of the downstream logic. For example see how things get passed through WrappingNullableUtils#prepareSerde(specificSerde, contextkeySerde, contextValueSerde) So, it's possible but it just might involve more work. Maybe not "Everywhere serdes are used" painful, though > Change the default "default serde" from ByteArraySerde to null > -------------------------------------------------------------- > > Key: KAFKA-9559 > URL: https://issues.apache.org/jira/browse/KAFKA-9559 > Project: Kafka > Issue Type: Improvement > Components: streams > Reporter: A. Sophie Blee-Goldman > Assignee: Leah Thomas > Priority: Blocker > Fix For: 3.0.0 > > > The current default "default serde" is not particularly useful, and in almost > all cases is intended to be overwritten either by setting the config > explicitly or by specifying serdes directly in the topology. If a user does > not set the config and misses specifying a serde they will get a runtime > ClassCastException once they start processing unless they are in fact > processing only bytes. > We should change the default default to null, so that an exception will > instead be thrown immediately on startup if a user failed to specify a serde > somewhere in their topology and it falls back to the unset default. > -- This message was sent by Atlassian Jira (v8.3.4#803005)