Open nathan-brainkey opened 1 month ago
Hi @nathan-brainkey, yes, the partition_id is mandatory. However, you can do a round-robin based on the number of partitions. Here is an example code:
let stream = iter(0..NUMBER_OF_PARTITIONS).map(|i| ProduceMessage {
topic: topic_name.to_string(),
partition_id: i,
key: None,
value: Some(bytes::Bytes::from_static(b"0123456789")),
headers: vec![],
});
You can find more of this example in the project's tests/multi_partitions_setup.rs
file.
Let me know if this helps you.
Is there a way to use round robin assignment to partitions for producers?
From the example:
It doesn't look like partition_id is Optional.
New to Samsa and just wondering how I might do this. Thanks for the help!