We are creating a Pulsar client service that should enable message acknowledgment with a previously serialized message ID.
During our tests:
No error is thrown during ID deserialization (calling toString on the deserialized message ID also returns a valid value);
No error is thrown during message acknowledgment using acknowledgeId method;
The message that should be acknowledged after the process isn't marked to delete by Pulsar and is received again after resubscription when we use the deserialized message ID.
This makes the deserialized message ID unusable for acknowledging the message. When we use message ID retrieved directly from a received message (without serialization/deserialization) acknowledgment by ID works correctly.
Below is a short version of the code that doesn't seem to work even though no error is thrown
consumer.acknowledgeId(MessageId.deserialize(message.getMessageId().serialize()))
Some data (maybe a topic) is probably lost during serialization/deserialization, making the deserialized message ID useless. However, the fact that the acknowledgeId method returns no error seems strange.
Expected behavior:
The deserialized message ID should enable acknowledging a message.
pulsar-client version: 1.12.0 Pulsar version: 4.0.0
We are creating a Pulsar client service that should enable message acknowledgment with a previously serialized message ID.
During our tests:
toString
on the deserialized message ID also returns a valid value);acknowledgeId
method;This makes the deserialized message ID unusable for acknowledging the message. When we use message ID retrieved directly from a received message (without serialization/deserialization) acknowledgment by ID works correctly.
Below is a short version of the code that doesn't seem to work even though no error is thrown
consumer.acknowledgeId(MessageId.deserialize(message.getMessageId().serialize()))
Some data (maybe a topic) is probably lost during serialization/deserialization, making the deserialized message ID useless. However, the fact that the
acknowledgeId
method returns no error seems strange.Expected behavior: The deserialized message ID should enable acknowledging a message.
I'm also attaching a link to the repo with the error reproduction https://github.com/adam987/pulsar-message-id-deserialization