Open CrazyLionHeart opened 3 years ago
В продюсере может быть использован partitioner:
partitioner (callable) – Callable used to determine which partition each message is assigned to. Called (after key serialization): partitioner(key_bytes, all_partitions, available_partitions). The default partitioner implementation hashes each non-None key using the same murmur2 algorithm as the java client so that messages with the same key are assigned to the same partition. When a key is None, the message is delivered to a random partition (filtered to partitions with available leaders only, if possible).
В нашем случае, ключ не передает
key (optional) – a key to associate with the message. Can be used to determine which partition to send the message to. If partition is None (and producer’s partitioner config is left as default), then messages with the same key will be delivered to the same partition (but if key is None, partition is chosen randomly). Must be type bytes, or be serializable to bytes via configured key_serializer.
Поэтому должны использоваться рандомные партиции.
В коде явно прописано использовать только один партишн - 0.
Необходимо реализовать использование рандомизированного партишинера.