Skip to content

KeyValue schema doesn't handle null key and null value well #4804

@sijie

Description

@sijie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/clienttype/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions