Serializers and Deserializers
The Schema Repository includes a library for serializing and deserializing messages. A producer application uses a schema to serialize a message for transmission. The consumer application deserializes the incoming message using the schema ID referenced in the message to:
-
Validate the message has been serialized using a recognized schema
-
Identify the fields in the message by field name and data type
The resulting message content is made available to the consumer.
In the application code, developers reference the Avro serializer for the producer to encode multi-field messages (and possibly also register a schema in the Schema Repository). Developers reference the deserializer to ensure the consumer is using the correct known schema before decoding the message for processing.
-
Producer:
com.tibco.messaging.kafka.avro.AvroSerializer -
Consumer:
com.tibco.messaging.kafka.avro.AvroDeserializer
The Schema Repository supports these primitive types:
Boolean
byte[]
Double
Float
Integer
Long
String
The Schema Repository supports the following Avro logical types:
UUID
Date
TimeMillis
TimeMicros
TimestampMillis
TimestampMicros
LocalTimestampMillis
LocalTimestampMicros
For details on Avro schemas, as well as serializing and deserializing, see the Apache Avro documentation.