Versions Compared

Key

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

...

  • A new overloaded method partition(String topic, Object key, byte[] keyBytes, Object value, byte[] valueBytes, Cluster cluster, Headers headers) with default implementation to call the existing method.
  • The object passed as headers is readonly and cannot be updated.
  • Details :

    Code Block
     /**
    * Compute the partition for the given record. Not overriding this method in the Partitioner interface has the same behaviour as using the existing method. The object passed as headers is readonly and cannot be updated.
    * 
    * @param topic The topic name
    * @param key The key to partition on (or null if no key)
    * @param keyBytes The serialized key to partition on( or null if no key)
    * @param value The value to partition on or null
    * @param valueBytes The serialized value to partition on or null
    * @param cluster The current cluster metadata
    * @param headers The headers to partition on or null
    */
    default int partition(String topic, Object key, byte[] keyBytes, Object value, byte[] valueBytes, Cluster cluster, Headers headers) {
    return partition(topic, key, keyBytes, value, valueBytes, cluster);
    };


...

  • What impact (if any) will there be on existing users?
    • NoneAn implementation of the new interface will be incompatible with old clients.
  • If we are changing behavior how will we phase out the older behavior?
    • NA
  • If we need special migration tools, describe them here.
    • NA
  • When will we remove the existing behavior?
    • NA

...