File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,6 +197,11 @@ class PULSAR_PUBLIC Message {
197197 */
198198 const std::string& getSchemaVersion () const ;
199199
200+ /* *
201+ * Set the schema version of the message.
202+ */
203+ void setSchemaVersion (const std::string& schemaVersion);
204+
200205 /* *
201206 * Get the producer name which produced this message.
202207 *
Original file line number Diff line number Diff line change @@ -209,6 +209,12 @@ const std::string& Message::getSchemaVersion() const {
209209 return impl_->getSchemaVersion ();
210210}
211211
212+ void Message::setSchemaVersion (const std::string& schemaVersion) {
213+ if (impl_) {
214+ impl_->metadata .set_schema_version (schemaVersion);
215+ }
216+ }
217+
212218uint64_t Message::getPublishTimestamp () const { return impl_ ? impl_->getPublishTimestamp () : 0ull ; }
213219
214220uint64_t Message::getEventTimestamp () const { return impl_ ? impl_->getEventTimestamp () : 0ull ; }
Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ int pulsar_message_has_schema_version(pulsar_message_t *message) {
141141 return message->message .hasSchemaVersion ();
142142}
143143
144+ void pulsar_message_set_schema_version (pulsar_message_t *message, const char *schemaVersion) {
145+ message->message .setSchemaVersion (schemaVersion ? schemaVersion : " " );
146+ }
147+
144148const char *pulsar_message_get_producer_name (pulsar_message_t *message) {
145149 return message->message .getProducerName ().c_str ();
146150}
You can’t perform that action at this time.
0 commit comments