feat: add the partitionKey to the messages
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 the getIndividualMsgsFromBatch method, so the resulting messages would contain the corresponding partition keys.
Modifications
- added the
PartitionKeyto themessagemodel. - adjusted the
getIndividualMsgsFromBatchmethod to load the partition key to the resulting messages.
Verifying this change
-
[x] 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 -
[x]
no-need-docnot affecting any current behavior, so maybe no update is required?
-
[ ]
doc
@benjamin99:Thanks for your contribution. For this PR, do we need to update docs? (The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
@benjamin99:Thanks for providing doc info!
@zymap Could you review this PR?