-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat: add the partitionKey to the messages #992
base: master
Are you sure you want to change the base?
feat: add the partitionKey to the messages #992
Conversation
@benjamin99:Thanks for your contribution. For this PR, do we need to update docs? |
@benjamin99:Thanks for providing doc info! |
Payload []byte | ||
Topic string | ||
Properties map[string]string | ||
PartitionKey string |
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.
PartitionKey string | |
PartitionKey *string |
is it better?
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.
I have considered both of the options, but overall I think it would be better to use string
type since 1) it makes no sense to set the partition key to be the empty string for any pulsar message, and 2) it is more common to see the string
as the property type instead of the string pointer.
Still I can make the change if you think it might be better to maintain the same type as the one defined in the SingleMessageMetadata
.
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.
Hi @nodece sorry for bothering, but I just wanna know if there is there anything I can do to make further progress as regarding the PR?
@zymap Could you review this PR? |
Motivation
In my usage, I need to get the partition key of the messages, which is not currently supported in the
pulsarctl
.The PR added the instruction to load partition key from the
SingleMessageMetadata
in thegetIndividualMsgsFromBatch
method, so the resulting messages would contain the corresponding partition keys.Modifications
PartitionKey
to themessage
model.getIndividualMsgsFromBatch
method to load the partition key to the resulting messages.Verifying this change
Make sure that the change passes the CI checks.
not sure the tests is required for the PR, since not seeing any message related tests in the current codebase (if I miss out anything, please let me know and I will complete the tests ASAP).
Documentation
Check the box below.
Need to update docs?
doc-required
no-need-doc
not affecting any current behavior, so maybe no update is required?
doc