Migrate MockProducer constructors removed in Kafka 4.0

Proprietary

Kafka 4.0 removed the MockProducer constructors that take no Partitioner, along with the DefaultPartitioner they used. Pass null as the partitioner instead. With an empty Cluster, which the constructor without one uses, MockProducer sends every record to partition 0 either way; with a Cluster that has partitions, a record without a partition now goes to the topic's first partition instead of the one its key hashes to.

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

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