Partition Key in Kafka Output

430 views
Skip to first unread message

David Kleiner

unread,
Mar 14, 2019, 5:32:10 PM3/14/19
to Fluent-Bit
Hello,

I'm trying to assign a partition key in kafka output but can't find the right spell.  

Fluentd has default_partition_key, I can't find a setting in librdkafka.

Librdkafka has paritioner strategy which defaults to consistent_random on the key but I can't find a way to specify that key of if it's possible - is it referring to the whole payload as the key? 

The reasoning: getting  time-ordered search results from a specific partition.

Thanks,

David

Eduardo Silva

unread,
Mar 20, 2019, 5:54:57 PM3/20/19
to David Kleiner, Fluent-Bit
Hi, 

Since Fluent Bit Kafka connector depends on librdkafka, I "think" (not sure) you can tweak the option "partitioner":


Any configuration option that you see in the file above can be set in Fluent Configuration with the prefix rdkafka., e.g:

to set "partitioner" you use "rdkafka.partitioner  SOMEVALUE". 

regards, 

--
You received this message because you are subscribed to the Google Groups "Fluent-Bit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluent-bit+...@googlegroups.com.
To post to this group, send email to fluen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fluent-bit/f82899f3-a3cb-4e3b-85d5-90f21f15be95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Eduardo Silva
Principal Engineer  | Arm
. . . . . . . . . . . . . . . . . . . . . . . . . . . 
m. +506 70138007
Arm.com
Treasuredata.com


http://twitter.com/edsiper  http://www.linkedin.com/in/edsiper 


David Kleiner

unread,
Mar 20, 2019, 6:55:41 PM3/20/19
to Fluent-Bit
Thank you for the pointer, Eduardo.  Which key is being used for partitioning?  I can't find its definition in the librdkafka config  Is it set on the kafka side? 

Eduardo Silva

unread,
Mar 25, 2019, 5:53:48 PM3/25/19
to David Kleiner, Fluent-Bit
I am not a Kafka user/expert, but looking at the config file I see the relevant keys:

partition.assignment.strategy: range,roundrobin
- partitioner: random, consistent, consistent_random, murmur2 and murmur2_random
partitioner_cb -> looks like a callback that can be used to set a partitioner when a producing to RD_KAFKA_PARTITION_UA, but that's not our case

you have to use some of the partitioner's available


For more options, visit https://groups.google.com/d/optout.

David Kleiner

unread,
Mar 25, 2019, 5:56:19 PM3/25/19
to Eduardo Silva, Fluent-Bit
Thanks again, I'll keep looking!
Reply all
Reply to author
Forward
0 new messages