-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] DLQ to handle bytes key properly #23172
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Good catch!
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: pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TypedMessageBuilderImpl.java Lines 124 to 150 in f3c177e
getKey and getKeyBytes in MessageImpl:pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java Lines 613 to 636 in 8c50a6c
|
@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. pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java Lines 628 to 636 in 15b88d2
|
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
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: dlg99#19