I upgraded from spring-kafka 2.7.2 to 2.8.4. I found my code broke where I had created my serialiser up front in my tests.
var serialiser = new KafkaAvroSerializer(schemaRegistryClient, mapOfProperties);
// I then pass this to my KafkaTemplate
...
...
KafkaTemplate then passes the serialiser to DefaultKafkaProducerFactory.
The DefaultKafkaProducerFactory does not know if the serialiser has already been configured and it attempts to call configure() on it again but this time with an empty map and it falls over because some mandatory properties are missing e.g. schema.registry.url
.
Is the way forward to stop pre-configuring the serialiser and to delegate the serialiser configuration to spring?
I did some digging and found this PR which I think is related. https://github.com/spring-projects/spring-kafka/pull/1907
It's a shame the serialiser doesn't have a isConfigured() flag to prevent reconfiguration.