public abstract class BytesApiMessageSerde extends Object
ApiMessageAndVersion to bytes and vice versa.. This can be used as serialization protocol for any
metadata records derived of ApiMessages. It internally uses AbstractApiMessageSerde for serialization/deserialization
mechanism.
Implementors need to extend this class and implement apiMessageFor(short) method to return a respective
ApiMessage for the given apiKey. This is required to deserialize the bytes to build the respective
ApiMessage instance.| Constructor and Description |
|---|
BytesApiMessageSerde() |
| Modifier and Type | Method and Description |
|---|---|
abstract org.apache.kafka.common.protocol.ApiMessage |
apiMessageFor(short apiKey)
Return
ApiMessage instance for the given apiKey. |
ApiMessageAndVersion |
deserialize(byte[] data) |
byte[] |
serialize(ApiMessageAndVersion messageAndVersion) |
public byte[] serialize(ApiMessageAndVersion messageAndVersion)
public ApiMessageAndVersion deserialize(byte[] data)
public abstract org.apache.kafka.common.protocol.ApiMessage apiMessageFor(short apiKey)
ApiMessage instance for the given apiKey. This is used while deserializing the bytes
payload into the respective ApiMessage in deserialize(byte[]) method.apiKey - apiKey for which a ApiMessage to be created.