[fix][client-cpp] Implement missing pulsar_message_set_schema_version in C API#552
Open
zhanglistar wants to merge 2 commits intoapache:mainfrom
Open
[fix][client-cpp] Implement missing pulsar_message_set_schema_version in C API#552zhanglistar wants to merge 2 commits intoapache:mainfrom
zhanglistar wants to merge 2 commits intoapache:mainfrom
Conversation
added 2 commits
March 16, 2026 17:13
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.
Fixes #522
Motivation
pulsar_message_set_schema_versionis declared ininclude/pulsar/c/message.hbut was never implemented. There is no delegating C function inlib/c/c_Message.cc, so linking fails when the symbol is used (e.g. when generating bindings from the C headers). This PR adds the missing implementation so the C API is complete and linkable.Modifications
void setSchemaVersion(const std::string& schemaVersion)onMessage.Message::setSchemaVersion()by settingimpl_->metadata.set_schema_version(schemaVersion)so getters (getSchemaVersion/hasSchemaVersion) see the updated value.pulsar_message_set_schema_version(pulsar_message_t *message, const char *schemaVersion)to callmessage->message.setSchemaVersion(schemaVersion ? schemaVersion : "").Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
(The new C function mirrors existing pairs like
pulsar_message_get_schemaVersion/pulsar_message_has_schema_versionand is a thin wrapper; existing message and C API tests continue to apply.)Documentation
doc-requireddoc-not-needed(C API already documents this function in the header; no separate doc update required.)
docdoc-complete