I wanted to suggest an alternative to the serialization issue. As I understand it, the concern is that if the user is responsible for serialization it becomes difficult for them to compute the partition as the plugin that computes the partition would be called with byte[] forcing the user to de-serialize the object in order to determine the correct partition. My suggestion is to do away with the plugin and instead provide a method like
RecordSend send(byte[] data, int partition) That way, if the user wants to compute the partition themselves they can do that with the regular object before they serialize it.