pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mme...@apache.org
Subject [pulsar] branch master updated: Exposing getSchemaVersion in the client by making it public. (#3744)
Date Mon, 04 Mar 2019 19:28:41 GMT
This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new d847c35  Exposing getSchemaVersion in the client by making it public. (#3744)
d847c35 is described below

commit d847c3530018d5228de3e420c8be99ec8b7043cb
Author: Yuvaraj L <uvaraj6@gmail.com>
AuthorDate: Tue Mar 5 00:58:36 2019 +0530

    Exposing getSchemaVersion in the client by making it public. (#3744)
    
    * Exposing getSchemaVersion in the client by making it public.
    
    * Implemented getSchemaVersion in TopicMessageImpl.java
    
    * Changed the release version
---
 .../src/main/java/org/apache/pulsar/client/api/Message.java        | 7 +++++++
 .../src/main/java/org/apache/pulsar/client/impl/MessageImpl.java   | 3 ++-
 .../main/java/org/apache/pulsar/client/impl/TopicMessageImpl.java  | 5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Message.java b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Message.java
index 58e6162..e672ab0 100644
--- a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Message.java
+++ b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Message.java
@@ -180,4 +180,11 @@ public interface Message<T> {
      * @return message redelivery count
      */
     int getRedeliveryCount();
+
+    /**
+     * Get schema version of the message.
+     * @since 2.4.0
+     * @return Schema version of the message if the message is produced with schema otherwise
null.
+     */
+    byte[] getSchemaVersion();
 }
diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java
index 665fd36..30e1474 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java
@@ -228,7 +228,8 @@ public class MessageImpl<T> implements Message<T> {
         }
     }
 
-    private byte[] getSchemaVersion() {
+    @Override
+    public byte[] getSchemaVersion() {
         if (msgMetadataBuilder.hasSchemaVersion()) {
             return msgMetadataBuilder.getSchemaVersion().toByteArray();
         } else {
diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageImpl.java
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageImpl.java
index bf6b281..fff104d 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageImpl.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageImpl.java
@@ -143,6 +143,11 @@ public class TopicMessageImpl<T> implements Message<T> {
         return msg.getRedeliveryCount();
     }
 
+    @Override
+    public byte[] getSchemaVersion() {
+        return msg.getSchemaVersion();
+    }
+
     public Message<T> getMessage() {
         return msg;
     }


Mime
View raw message