I have been playing around with this example and possibly found an error.
(message.go row 235:) return int32(hasher(key)) % partitions
should be changed to
(message.go row 235:) return int32(hasher(key) % uint32(partitions))
Why? It seems that the hasher function gives too large numbers and the conversion from uint to int will give negative numbers.
Eg. int32: –2147483648 to 2147483647
uint32: 0 to 4294967295
BTW. I like this liftbridge and will certainly do something with it in the future. We use kafka, but I like this more - way more... Because of golang and speed.
I have been playing around with this example and possibly found an error. (message.go row 235:) return int32(hasher(key)) % partitions should be changed to (message.go row 235:) return int32(hasher(key) % uint32(partitions))
Why? It seems that the hasher function gives too large numbers and the conversion from uint to int will give negative numbers. Eg. int32: –2147483648 to 2147483647 uint32: 0 to 4294967295
BTW. I like this liftbridge and will certainly do something with it in the future. We use kafka, but I like this more - way more... Because of golang and speed.