Object - kafka : Serializer

Represents a Kafka serializer object. This object can be used to create custom serializers for the Ballerina Kafka producers.

Methods

Closes the serialization process.

Serializes the provided data.

close

Closes the serialization process. This function runs after the serialization process is done.

serialize

(any data)

returns byte[]

Serializes the provided data. Implement this to serialize any data type and return the byte[] value to use in the Kafka producer.

Parameters

  • data any
  • Data, which should be serialized

  • Return Type

    (byte[])
  • Serialized byte[] value