This project contains unit tests to reproduce the issue with handling null
values produced to Apache Pulsar topic that should represent tombstones (deletions of entities).
BUG #4804 described the issue and enhancement #7139 solved it.
The solution included a nullValue
flag inside message metadata used by MessageIml to indicate the presence of a null
value in the message to avoid calling Avro parsing code and directly return null
when calling Message.getValue()
.
New BUG#7407 was reported to track the new issue. Solution PR#7408 was provided, but it only fixes sending tombstones when message value is explicitly set to null
.
Solution however does not work for two reasons:
When trying to read a message with(now working with versions >= 2.7.0)null
value aNullPointerException
is thrown in other part of the code- It should not be required to explicitly indicate a
null
value to producer (only-key values should work just just fine). Exception thrown when working with implicitnull
value messages isEOFException
in this case
An Apache Pulsar instance must be running locally. If Docker Compose is installed on your computer (on Windows/Mac Docker Desktop will do) you can use provided docker-comopose.yml file:
$ cd src/test/resources
$ docker-compose up -d
To run the tests you can use your IDE or Maven from command line:
$ mvn test