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
FieldsModifier and TypeFieldDescriptionprotected final io.confluent.kafka.schemaregistry.client.SchemaRegistryClientprotected static final intprotected final org.apache.avro.message.RawMessageEncoder<T> static final intstatic final bytestatic final Stringprotected final org.apache.avro.Schemaprotected final intprotected final Stringprotected final io.confluent.kafka.serializers.KafkaAvroSerializer -
Constructor Summary
ConstructorsConstructorDescriptionAvroConfluentCodec(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.SchemaRegistryClientgetRegistryClient(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:CodecReturns the codec name -
encode
Description copied from interface:CodecEncodes the object returns a byte array representation. -
decode
Description copied from interface:CodecDecodes the byte array returns an object.
-