helpshift / ekaf

A minimal, high-performance Kafka client in Erlang.
https://engineering.helpshift.com
Other
165 stars 50 forks source link

produce_async vs produce_sync partition strategy #31

Open jurriaan opened 8 years ago

jurriaan commented 8 years ago

I'm trying to use this library in Elixir and while experimenting with the produce_async and produce_sync functions I found out that

Enum.map(1..10000, fn _ -> :ekaf.produce_sync("partitioning", "test") end)

did randomly distribute the messages while

Enum.map(1..10000, fn _ -> :ekaf.produce_async("partitioning", "test") end)

does not (all messages seem to end up in the same partition).

Am I missing some configuration? Or is this expected behaviour?

jurriaan commented 8 years ago

I fixed this by using strict round robin strategy instead of the default (which I thought should distribute messages randomly)