Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sijie opened this issue Jul 25, 2019 · 1 comment · Fixed by #7139
Closed

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

sijie opened this issue Jul 25, 2019 · 1 comment · Fixed by #7139
Labels
area/client type/bug The PR fixed a bug or issue reported a bug
Milestone

Comments

@sijie
Copy link
Member

sijie commented Jul 25, 2019

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.

@sijie sijie added type/bug The PR fixed a bug or issue reported a bug area/client component/schemaregistry labels Jul 25, 2019
@sijie sijie added this to the 2.4.1 milestone Jul 25, 2019
@jiazhai
Copy link
Member

jiazhai commented Aug 20, 2019

@sijie How about move this into 2.5.0?

@jiazhai jiazhai modified the milestones: 2.4.1, 2.5.0 Aug 22, 2019
@sijie sijie modified the milestones: 2.5.0, 2.6.0 Nov 25, 2019
codelipenghui pushed a commit that referenced this issue Jun 4, 2020
Fixes #4804  

Thanks, @nlu90, work at #6384.

### Motivation

Currently, the KeyValue schema doesn't handle `null` key and `null` value well.
cdbartholomew pushed a commit to kafkaesque-io/pulsar that referenced this issue Jul 24, 2020
Fixes apache#4804  

Thanks, @nlu90, work at apache#6384.

### Motivation

Currently, the KeyValue schema doesn't handle `null` key and `null` value well.
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this issue Aug 24, 2020
Fixes apache#4804  

Thanks, @nlu90, work at apache#6384.

### Motivation

Currently, the KeyValue schema doesn't handle `null` key and `null` value well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
2 participants