Object - kafka : Serializer

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

close

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

serialize

(any data)

returns byte[]

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

Parameters

  • data any
  • Data which should be serialized.

  • Return Type

    (byte[])
  • Serialized byte[] value.