heetch / felice

Felice is a nascent, opinionated Kafka library for Go, in Go
MIT License
20 stars 1 forks source link

Add minimal MurmurHash2 impl for partitioner #67

Closed philippgille closed 2 years ago

philippgille commented 2 years ago

felice uses github.com/burdiyan/kafkautil, which has a dependency on github.com/lovoo/goka. The latter uses Sarama v1.29.0 currently, and is not compatible with Sarama v1.31.1 for example, because it added new methods to an existing interface, which the goka structs don't implement yet. This leads to compile time errors in services that use Sarama v1.31.1 and felice when running go test ./... for example.

By adding the MurmurHash2 implementation directly in this code we can get rid of the dependency and make the Sarama upgrade possible.

The implementation is copied from https://github.com/burdiyan/kafkautil/blob/3e3bfeae0ffaf3b3d9b431463d9e58f840173188/partitioner.go

It's licensed under MIT license, just like felice currently is. I added the original copyright notice to the copied file.