Migrate Kafka Streams APIs removed in Kafka 4.0

Proprietary

Kafka 4.0 removed the Kafka Streams APIs deprecated in 3.6 or earlier. This migrates the window factories, keeping their grace period, and the StreamsMetadata class that metadataForAllStreamsClients() and streamsMetadataForStore() return.

io.moderne.kafka.MigrateRemovedStreamsApis
mod run . --recipe=io.moderne.kafka.MigrateRemovedStreamsApis

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Migrate TimeWindows.of() and SessionWindows.with() keeping their grace period
  2. Change method name org.apache.kafka.streams.kstream.SlidingWindows withTimeDifferenceAndGrace(java.time.Duration, java.time.Duration) to ofTimeDifferenceAndGrace
  3. Change type org.apache.kafka.streams.state.StreamsMetadata to org.apache.kafka.streams.StreamsMetadata