From: Kai Moritz Date: Sat, 2 Apr 2022 18:25:34 +0000 (+0200) Subject: Der Producer verwendet den UniformStickyPartitioner X-Git-Tag: uniform-sticky-DEPRECATED~3 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=36c05a16cd17c88a3eef117eb6a701ca65f2ff26;p=demos%2Fkafka%2Ftraining Der Producer verwendet den UniformStickyPartitioner --- diff --git a/README.sh b/README.sh index 3ec2781..d73d41a 100755 --- a/README.sh +++ b/README.sh @@ -1,6 +1,6 @@ #!/bin/bash -IMAGE=juplo/endless-producer:1.0-SNAPSHOT +IMAGE=juplo/uniform-sticky:1.0-SNAPSHOT if [ "$1" = "cleanup" ] then diff --git a/docker-compose.yml b/docker-compose.yml index d715e66..c75d746 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,7 @@ services: command: sleep infinity producer: - image: juplo/endless-producer:1.0-SNAPSHOT + image: juplo/uniform-sticky:1.0-SNAPSHOT ports: - 8000:8080 environment: diff --git a/pom.xml b/pom.xml index 267e035..9fd2ad5 100644 --- a/pom.xml +++ b/pom.xml @@ -12,8 +12,8 @@ de.juplo.kafka - endless-producer - Endless Producer: a Simple Producer that endlessly writes numbers into a topic + uniform-sticky + Uniform Sticky: a version of the Endless Producer, that uses uniform-sticky-partitioner 1.0-SNAPSHOT diff --git a/src/main/java/de/juplo/kafka/EndlessProducer.java b/src/main/java/de/juplo/kafka/EndlessProducer.java index 8b3743d..d283772 100644 --- a/src/main/java/de/juplo/kafka/EndlessProducer.java +++ b/src/main/java/de/juplo/kafka/EndlessProducer.java @@ -42,6 +42,7 @@ public class EndlessProducer implements Runnable props.put("client.id", clientId); props.put("acks", acks); props.put("metadata.max.age.ms", "1000"); + props.put("partitioner.class", "org.apache.kafka.clients.producer.UniformStickyPartitioner"); props.put("key.serializer", StringSerializer.class.getName()); props.put("value.serializer", StringSerializer.class.getName());