Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-1049

Encoder implementations are required to provide an undocumented constructor.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None

    Description

      So, it seems that if I want to set a custom serializer class on the producer (in 0.8), I have to use a class that includes a special constructor like:

      public class MyKafkaEncoder<MyType> implements Encoder<MyType> {
      // This constructor is expected by the kafka producer, used by reflection
      public MyKafkaEncoder(VerifiableProperties props)

      { // what can I do with this? }

      @Override
      public byte[] toBytes(MyType message)

      { return message.toByteArray(); }

      }

      It seems odd that this would be a requirement when implementing an interface. This seems not to have been the case in 0.7.

      What could my encoder class do with the VerifiableProperties?

      Attachments

        1. KAFKA-1049.patch
          5 kB
          Joel Jacob Koshy

        Activity

          People

            Unassigned Unassigned
            jbrosenberg@gmail.com Jason Rosenberg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: