pulsar-client-cpp icon indicating copy to clipboard operation
pulsar-client-cpp copied to clipboard

Support null value messages

Open BewareMyPower opened this issue 11 months ago • 2 comments

Currently the producer cannot send a null value message, which is used as a tombstone for a specific key on a compacted topic.

In addition, the consumer cannot differ empty values from null values, because all these values are presented as empty std::strings.

To solve this issue, we might need to add the following method to MessageBuilder:

MessageBuilder& setNullValue();

The method above should set the following field in MessageMetadata:

message MessageMetadata {
    // ...
    // Indicate if the message payload value is set
    optional bool null_value = 25 [default = false]

Then we can add a method to Message to indicate if the message has null value

bool isNullValue() const;

BewareMyPower avatar May 06 '25 12:05 BewareMyPower

@BewareMyPower can you assign this issue to me?

Bhargavkonidena avatar May 21 '25 13:05 Bhargavkonidena

OK

BewareMyPower avatar May 22 '25 05:05 BewareMyPower