Package org.nuxeo.lib.stream.codec
Class AvroConfluentCodec<T>
java.lang.Object
org.nuxeo.lib.stream.codec.AvroConfluentCodec<T>
- All Implemented Interfaces:
Codec<T>
Use the Confluent Avro encoding which differs from Avro message, the schema store is a REST Confluent Schema
Registry.
- Since:
- 10.3
-
Field Summary
Modifier and TypeFieldDescriptionprotected final io.confluent.kafka.schemaregistry.client.SchemaRegistryClient
protected static final int
protected final org.apache.avro.message.RawMessageEncoder<T>
static final int
static final byte
static final String
protected final org.apache.avro.Schema
protected final int
protected final String
protected final io.confluent.kafka.serializers.KafkaAvroSerializer
-
Constructor Summary
ConstructorDescriptionAvroConfluentCodec
(Class<T> messageClass, String schemaRegistryUrls) Create an AvroConfluent codec -
Method Summary
Modifier and TypeMethodDescriptiondecode
(byte[] data) Decodes the byte array returns an object.byte[]
Encodes the object returns a byte array representation.getName()
Returns the codec namestatic io.confluent.kafka.schemaregistry.client.SchemaRegistryClient
getRegistryClient
(String schemaRegistryUrls)
-
Field Details
-
NAME
- See Also:
-
MAGIC_BYTE
public static final byte MAGIC_BYTE- See Also:
-
ID_SIZE
public static final int ID_SIZE- See Also:
-
DEFAULT_IDENTITY_MAP_CAPACITY
protected static final int DEFAULT_IDENTITY_MAP_CAPACITY- See Also:
-
messageClass
-
schema
protected final org.apache.avro.Schema schema -
schemaId
protected final int schemaId -
schemaName
-
serializer
protected final io.confluent.kafka.serializers.KafkaAvroSerializer serializer -
encoder
-
client
protected final io.confluent.kafka.schemaregistry.client.SchemaRegistryClient client
-
-
Constructor Details
-
AvroConfluentCodec
Create an AvroConfluent codec- Parameters:
messageClass
- the class to encode and decodeschemaRegistryUrls
- a comma separated list of Confluent Schema Registry URL
-
-
Method Details
-
getRegistryClient
public static io.confluent.kafka.schemaregistry.client.SchemaRegistryClient getRegistryClient(String schemaRegistryUrls) -
getName
Description copied from interface:Codec
Returns the codec name -
encode
Description copied from interface:Codec
Encodes the object returns a byte array representation. -
decode
Description copied from interface:Codec
Decodes the byte array returns an object.
-