Closed
Description
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.3.6
Describe the bug
When creating a DelegatingByTypeSerializer
with assignable = true
, if one of the types in the input map is a child of another type, the serializer that gets picked is random.
To Reproduce
- Create a
DelegatingByTypeSerializer
withassignable = true
- Have one type in the input map as the child of another type
- When a message of the child type is send, the actual serializer used is random if the map used to create the serializer does not enforce order. This is because the contract does not enforce people to use a SequencedMap.
Expected behavior
The order in which the serializer is picked for a type if there are multiple available should be deterministic.
Sample
https://github.com/MaheshAravindV/spring-kafka-delegating-serializer-sample