pulsar-client-dotnet
pulsar-client-dotnet copied to clipboard
Message Key Lost in Retry and DLQ
I noticed that after using ReconsumeLaterAsync, the messages that originally had a value for the key have an empty key when consumed again.
I found that the issue is mainly in the function getOptionalKey in the file src\Pulsar.Client\Internal\DeadLetters.fs. This function only sets the PartitionKey when message.Key is empty.
let getOptionalKey (message: Message<'T>) =
if String.IsNullOrEmpty(%message.Key) then
Some { PartitionKey = message.Key; IsBase64Encoded = message.HasBase64EncodedKey }
else
None
Thanks for noticing! I've made a fix in 3.5.2, please verify