Closed lspgn closed 11 months ago
I have tried to deploy the binary built from this PR but it seems to have no effect 🤔 Messages are still produced to only a single partition. I don't use -mapping
so I suppose the key is nil
.
I can see it is being produced with a key
I have tried a build where I removed this line https://github.com/netsampler/goflow2/blob/3c00d97a67c8c84886fe4b60fc457381cc46183d/transport/kafka/kafka.go#L233 and now it's distributed randomly
Unfortunately, I have no way to debug where is the key being created at the moment. I've requested tcpdump
installation on the server where the sflow is being sent to so I can capture some packets, create sflow fixtures for goflow and debug it.
Could you check again @simPod?
~I think I found the problem: empty key had a fixed hash which didn't work with the RoundRobinPartitioner.~
I'm observing it working with the expected behavior even when key is fixed. Make sure -transport.kafka.hashing=false
For reference in Bitnami Kafka docker:
Create a topic with 9 partitions
$ /opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic flow-messages --partitions 9
Get the offsets
$ /opt/bitnami/kafka/bin/kafka-get-offsets.sh --topic flow-messages --bootstrap-server localhost:9092
flow-messages:0:1506
flow-messages:1:1506
flow-messages:2:4009
flow-messages:3:1506
flow-messages:4:1506
flow-messages:5:1506
flow-messages:6:8212
flow-messages:7:1506
flow-messages:8:1504
I can confirm it works without enabling -transport.kafka.hashing
. This can be now closed I guess https://github.com/netsampler/goflow2/issues/248