Migrate to Kafka 4.0
ProprietaryMigrate applications to the latest Kafka 4.0 release. This includes updating dependencies to 4.0.x and migrating the APIs and configuration that Kafka 4.0 removed. Kafka 4.0 clients and Kafka Streams require Java 11, and its other artifacts Java 17; upgrading Java is left to org.openrewrite.java.migrate recipes.
io. moderne. kafka. MigrateToKafka40mod run . --recipe= io. moderne. kafka. MigrateToKafka40Install 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.
- Migrate to Kafka 3.3
- Use the Scala 2.13 builds of Kafka
- Upgrade Gradle or Maven dependency versions
org.apache.kafka:*:4.0.x - Remove deprecated Kafka property
log.message.format.version - Remove deprecated Kafka property
message.format.version - Remove deprecated Kafka property
inter.broker.protocol.version - Delete property by key
log.message.format.version - Delete property by key
message.format.version - Delete property by key
inter.broker.protocol.version - Add comment before property key
- Add comment before property key
- Add comment before property key
- Add comment before property key
- Migrate deprecated
sendOffsetsToTransactionto useConsumerGroupMetadata - Migrate
Consumer.poll(long)topoll(Duration) - Migrate
Consumer.committed(TopicPartition)tocommitted(Set<TopicPartition>) - Migrate
ConsumerRecordconstructors removed in Kafka 4.0 - Migrate
MockProducerconstructors removed in Kafka 4.0 - Migrate
ConsumerGroupStatetoGroupState - Migrate
AdminClient.alterConfigs()toincrementalAlterConfigs() - Change method name
org.apache.kafka.clients.admin.DescribeTopicsResult values()totopicNameValues - Delete method argument 4 in methods
org.apache.kafka.clients.producer.RecordMetadata <constructor>(org.apache.kafka.common.TopicPartition, long, long, long, Long, int, int) - Migrate client and Admin APIs removed in Kafka 4.0
- Migrate Kafka Streams APIs removed in Kafka 4.0
- Migrate broker and client configuration removed in Kafka 4.0
- Migrate MirrorMaker 2 configuration removed in Kafka 4.0