O'Reilly logo
  • black zwei thinks this is interesting:

if (((String) key).equals("Banana")) return numPartitions; // Banana will always go to last partition

From

Cover of Kafka: The Definitive Guide

Note

should be numPartitions - 1?