Describe the bug
Similar as #4803, it is impossible to specify null key or null value in KeyValue schema. It throws exception as below:
java.lang.NullPointerException
at java.util.Base64$Encoder.encode(Base64.java:261)
at java.util.Base64$Encoder.encodeToString(Base64.java:315)
at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.value(TypedMessageBuilderImpl.java:109)
To Reproduce
producer.newMessage().value(new KeyValue(null, "test-value")).send();
Expected behavior
Be able to support null key and null value.