You can just send it SIGTERM signal, or if you're running it off the
command-line for testing, ctrl-C will do a clean shutdown.
> Also my understanding is, If I send a message to a partition by specifying
> a partition key, all the messages sent from that producer will be sent to
> the same partition. If so how does a consumer get that message without
> knowing which partition the message was sent to. I know the consumer gets
> the messages from the topic by subscription. Are the messages replicated
> between the partitions? If so how ?
Right now, there is no custom partitioning on the consumer-side. Each
partition will be consumed by at most one consumer within a consumer group
(this is described at the end of the design document: