Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add a new headers length and value (byte[]) to the core message format.
  2. Create a Header Interface and implementing class
    1. Interface

      Code Block
      public interface Header
      {
         String key();
      
         byte[] value();
      }
      
      
      
    2. Implementation Detail

      1. Add a String key field to Header implementing class
      2. Add a byte[] value field to Header implementing class

  3. Create a Headers Interface and implementing class 
    1. Interface

      Code Block
      public interface Headers extends Iterable<Header>
      {
         Headers add(String key, byte[] value);
      
         Collection<byte[]> get(String key);
      
         Set<String> keys();
      }
      
      
    2. Implementation Detail

      1. Add a headers Header[] field to Headers implementation class

      2. Add accessor methods on the Headers class - void Headers add(String key, byte[] value) and a Collection<byte[]> get(String)
      3. implement Iterable<Header>
  4. Add a headers field to ProducerRecord and ConsumerRecord. 
  5. Add accessor methods on the Producer/ConsumerRecord Headers getHeaders()
    1. Code Block
      public class ProducerRecord<K, V> {
         
         ...
         
         public Headers getHeaders();
         
         ...
         
      }
       
      Code Block
      public class ConsumerRecord<K, V> {
         
         ...
         
         public Headers getHeaders();
         
         ...
         
      }
       
  6. Add ProduceRequest/ProduceResponse V4 which uses the new message format.
  7. Add FetchRequest/FetchResponse V4 which uses the new message format.
  8. The serialisation of the [String, byte[]] header array will on the wire using a strict format
  9. Each headers value will be custom serialisable by the interceptors/plugins that use the header.

...