Skip to content

Commit

Permalink
Exposing getSchemaVersion in the client by making it public. (#3744)
Browse files Browse the repository at this point in the history
* Exposing getSchemaVersion in the client by making it public.

* Implemented getSchemaVersion in TopicMessageImpl.java

* Changed the release version
  • Loading branch information
skyrocknroll authored and merlimat committed Mar 4, 2019
1 parent e06a894 commit d847c35
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ public byte[] getData() {
}
}

private byte[] getSchemaVersion() {
@Override
public byte[] getSchemaVersion() {
if (msgMetadataBuilder.hasSchemaVersion()) {
return msgMetadataBuilder.getSchemaVersion().toByteArray();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ public int getRedeliveryCount() {
return msg.getRedeliveryCount();
}

@Override
public byte[] getSchemaVersion() {
return msg.getSchemaVersion();
}

public Message<T> getMessage() {
return msg;
}
Expand Down

0 comments on commit d847c35

Please sign in to comment.