[fix] DLQ to handle bytes key properly#23172
Conversation
|
A message could also have a separate pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java Lines 1187 to 1196 in 15b88d2 The handling for |
|
These code snippets helped understand this PR: getKey and getKeyBytes in MessageImpl: |
@dlg99 I guess the key bytes itself doesn't change, but the encoding changes? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23172 +/- ##
============================================
+ Coverage 73.57% 74.53% +0.96%
+ Complexity 32624 2755 -29869
============================================
Files 1877 1920 +43
Lines 139502 144468 +4966
Branches 15299 15804 +505
============================================
+ Hits 102638 107679 +5041
+ Misses 28908 28531 -377
- Partials 7956 8258 +302
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Correct, the hasBase64EncodedKey state is lost thus the key is not decoded into bytes. |
Thanks for sharing the context @dlg99 |
(cherry picked from commit 46c25ac)
(cherry picked from commit 46c25ac)
(cherry picked from commit 46c25ac)
(cherry picked from commit 46c25ac)
redo of apache#23172 on LS 2.10
Motivation
DLQ producer implicitly converts byte[] key into a bas64-encoded string representing that byte array.
Modifications
Handling setting of keys that are hasBase64EncodedKey() differently.
Verifying this change
This change added a unit test.
Does this pull request potentially affect one of the following parts:
NO
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: dlg99#19