I know that quotas are based on client-id
. Basically I want to run the kafka-producer-perf-test
with a particular client id to test whether the quotas work properly.
How can I assign a client-id
for a particular producer (or) partition?
When creating a producer, you can assign a unique value to client.id
property
Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.put("client.id", "testclient001");
//set any additional properties.
Producer<String, GenericRecord> producer = new KafkaProducer<String, GenericRecord>(props);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With