Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Window size is not passed to the Kafka consumer during windowed aggregations, so the consumer uses the default Long.MAX_VALUE when initializing the deserializer. Both Both TimeWindowedSerde and TimeWindowedDeserializer have a default constructor that does not require a window size, causing fatal errors at runtime for some programs. 

Public Interfaces

In StreamsConfig.java add window.size.ms

...

languagejava
titleStreamsConfig
linenumberstrue

...

Deprecate the following methods

Code Block
languagejava
titleWindowedSerdes
linenumberstrue
@Deprecated
public TimeWindowedSerde(final Serde<T> inner) {
	super(new TimeWindowedSerializer<>(inner.serializer()), new TimeWindowedDeserializer<>(inner.deserializer()));
}
Code Block
languagejava
titleTimeWindowedDeserializer
linenumberstrue
@Deprecated
public TimeWindowedDeserializer(final Deserializer<T> inner) {
	this(inner, Long.MAX_VALUE);
}

/**
* Construct a {@code TimeWindowedSerde} object for the specified inner class type.
*/
@Deprecated
static public <T> Serde<Windowed<T>> timeWindowedSerdeFrom(final Class<T> type) {
	return new TimeWindowedSerde<>(Serdes.serdeFrom(type));
}

Proposed Changes

...


Code Block
languagejava
titleTimeWindowedDeserializer
linenumberstrue
@Deprecated
public TimeWindowedDeserializer(final Deserializer<T> inner) {
	this(inner, Long.MAX_VALUE);
}


Proposed Changes

Deprecate .Additionally, deprecate constructors in both TimeWindowedDeserializer and WindowedSerdes that don't require a window size. This ensures that the window size would be properly set before encountering any instances where it should be used.Note that to use the windows.size.ms config through the console consumer (if desired), add the key.deserializer prefix and pass it in as a property.

Compatibility, Deprecation, and Migration Plan

...