[ https://issues.apache.org/jira/browse/KAFKA-10366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17172633#comment-17172633 ]
Sophie Blee-Goldman commented on KAFKA-10366: --------------------------------------------- Yeah, there are two related problems. The first one is KAFKA-9649, where you can get in trouble by using a TimeWindowedSerde constructor that appears legit but sets the windowSize to a random default. I agree with your conclusion in that ticket, we should deprecate the TimeWindowedSerde(innerClass) constructor. If you're forced to pass in the windowSize, then things work, because Streams uses the actual Serde object that you pass into your topology. So for example a TimeWindowedSerde passed in to a Materialized or Consumed would properly set the window end time upon deserialization. Unfortunately, you can only set the deserializer _class_ for the Consumer, which then instantiates its own Deserializer through reflection. You're supposed to do all configuration for it in the Deserializer#configure class. Unfortunately, TimeWindowedDeserializer#deserialize only sets the innerClass. The second problem, which this ticket targets, isn't really an issue for Streams users. Streams uses a plain Consumer<byte[], byte[]> and does all the deserialization itself, with the passed-in serde objects. It's just a problem for anyone who wants to consume TimeWindowed records directly. Even then, you can always use the workaround of consuming plain bytes and deserializing them yourself, so it's really more of an annoyance. It would be nice to have this fixed for tests in particular. In general though any Serdes that we support out-of-the-box should probably work throughout Kafka, so we should consider introducing a config to set the windowSize similar to what we do for the inner class > TimeWindowedDeserializer doesn't allow users to set a custom window size > ------------------------------------------------------------------------ > > Key: KAFKA-10366 > URL: https://issues.apache.org/jira/browse/KAFKA-10366 > Project: Kafka > Issue Type: Bug > Reporter: Leah Thomas > Assignee: Leah Thomas > Priority: Major > Labels: streams > > Related to [KAFKA-4468|https://issues.apache.org/jira/browse/KAFKA-4468], in > timeWindowedDeserializer Long.MAX_VALUE is used as _windowSize_ for any > deserializer that uses the default constructor. While streams apps can pass > in a window size in serdes or while creating a timeWindowedDeserializer, the > deserializer that is actually used in processing the messages is created by > the Kafka consumer, without passing in the set windowSize. The deserializer > the consumer creates uses the configs, but as there is no config for > windowSize, the window size is always default. > See _KStreamAggregationIntegrationTest #ShouldReduceWindowed()_ as an example > of this issue. Despite passing in the windowSize to both the serdes and the > timeWindowedDeserializer, the window size is set to Long.MAX_VALUE. -- This message was sent by Atlassian Jira (v8.3.4#803005)