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

Message Key Lost in Retry and DLQ

Open xwwwx opened this issue 1 year ago • 1 comments

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

xwwwx avatar Jul 15 '24 07:07 xwwwx

Thanks for noticing! I've made a fix in 3.5.2, please verify

Lanayx avatar Jul 15 '24 13:07 Lanayx