Fix the issue of unable to parse non-batch messages that with non-empty properties and empty payloads.#1435
Merged
RobertIndie merged 5 commits intomasterfrom Nov 13, 2025
Merged
Conversation
…ty properties and empty payloads.
0a18a00 to
778835c
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes handling of non-batched messages with empty payloads but non-empty properties. Previously, the ReadMessage() function would return an error (ErrEOM) when encountering such messages, but the fix allows these messages to be properly read by returning an empty byte slice instead.
Key changes:
- Added
hasPropertiesfield toMessageReaderto track whether the message metadata contains properties - Modified
ReadMessage()to return[]byte{}(empty payload) instead ofErrEOMfor non-batched messages with properties and empty payloads - Updated existing test to verify the new behavior and added comprehensive end-to-end test
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pulsar/internal/commands.go | Added hasProperties field to track message properties; modified ReadMessage() to handle empty payloads with properties |
| pulsar/internal/commands_test.go | Updated test to verify empty payload is returned instead of ErrEOM for old format messages with properties |
| pulsar/reader_test.go | Added end-to-end test for empty payload messages with properties in non-batched mode |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RobertIndie
reviewed
Nov 5, 2025
RobertIndie
approved these changes
Nov 13, 2025
|
Thanks @RobertIndie and @coderzc - do you have a sense when the next release is that we will get this change? |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Modifications
Correct parse non-batch messages that with non-empty properties and empty payloads.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation