Can you post the sample code?

On Mon, Oct 23, 2017 at 8:53 PM, Andrea Giordano <
andrea.giordano....@gmail.com> wrote:

> Hi,
> I set a Kafka broker with some topics and where each topic is divided into
> 10 partitions.
> As I understood on Kafka doc, if I send a keyed message to kafka the key
> is used to distribute the message in a particular partition (using an hash
> value of the key): in this way messages with same key go in the same
> partition.
>
> I’m trying to run the broker sending messages with the same key and I
> noted that executing the following command:
>
> bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list
> localhost:9092 --topic LCacc --time -1
>
>
> I obtained the output:
>
> Honestly I expected to see just a partition full (due to the only one key
> used). Instead it seems kafka distributed message in a quite uniform way.
> Is this normal?
> I tried also to send messages with different keys (for example sending
> much more messages with a key respect to another) but nothing changed.
>
> LCacc:8:60699
> LCacc:2:60737
> LCacc:5:60716
> LCacc:4:60722
> LCacc:7:60701
> LCacc:1:60744
> LCacc:9:60695
> LCacc:3:60731
> LCacc:6:60710
> LCacc:0:61967
>
>

Reply via email to