Today with librdkafka there are two options for partition.assignment.strategy librdkafka: range and round-robin. I am looking if there is a way to add a custom assignment strategy.
Bests
Today with librdkafka there are two options for partition.assignment.strategy librdkafka: range and round-robin. I am looking if there is a way to add a custom assignment strategy.
Bests
There is also another one strategy, too. A newer strategy is called Sticky that was added in version 0.11.0. One of the major reasons that it came about is to not only try and distribute topic partitions as evenly as possible, but also to have partitions stay with their existing consumers if possible.
Of course, you can also create your own strategy. Currently, AbstractPartitionAssignor
is an abstract class that does some of the common work with mining data about topics to help implement your logic.
This blog explains custom assignment strategy.
As of today (Jun. 18, 2021), it is not supported yet by librdkafka.
You can find the feature request here: https://github.com/edenhill/librdkafka/issues/2284
You can only choose from one of the 3 built-in strategies (range, roundrobin, cooperative-sticky). Documented here: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md