zhanglistar opened a new pull request, #552:
URL: https://github.com/apache/pulsar-client-cpp/pull/552

   <!--
   ### Contribution Checklist
   
     - PR title format should be *[type][component] summary*. For details, see 
*[Guideline - Pulsar PR Naming 
Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*.
   
     - Fill out the template below to describe the changes contributed by the 
pull request. That will give reviewers the context they need to do the review.
   
     - Each pull request should address only one issue, not mix up code from 
multiple issues.
   
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and 
this checklist, leaving only the filled out template below.
   -->
   
   Fixes #522 
   
   <!-- If there is an existing GitHub issue for "C API 
pulsar_message_set_schema_version declared but not implemented", put the issue 
number above; otherwise remove the Fixes line or leave as Fixes #<xyz> -->
   
   ### Motivation
   
   `pulsar_message_set_schema_version` is declared in 
`include/pulsar/c/message.h` but was never implemented. There is no delegating 
C function in `lib/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
   
   - **include/pulsar/Message.h**: Declare `void setSchemaVersion(const 
std::string& schemaVersion)` on `Message`.
   - **lib/Message.cc**: Implement `Message::setSchemaVersion()` by setting 
`impl_->metadata.set_schema_version(schemaVersion)` so getters 
(`getSchemaVersion` / `hasSchemaVersion`) see the updated value.
   - **lib/c/c_Message.cc**: Implement 
`pulsar_message_set_schema_version(pulsar_message_t *message, const char 
*schemaVersion)` to call `message->message.setSchemaVersion(schemaVersion ? 
schemaVersion : "")`.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   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_version` and is 
a thin wrapper; existing message and C API tests continue to apply.)*
   
   ### Documentation
   
   - [ ] `doc-required`
   
   - [x] `doc-not-needed`
     (C API already documents this function in the header; no separate doc 
update required.)
   
   - [ ] `doc`
   
   - [ ] `doc-complete`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to