sumup.adder.bootstrap-server: kafka:9092
sumup.adder.client-id: adder-1
sumup.adder.commit-interval: 3s
+ sumup.adder.throttle: 3ms
spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017
spring.data.mongodb.database: juplo
- logging.level.org.apache.kafka.clients.consumer: DEBUG
adder-2:
image: juplo/sumup-adder:1.0-SNAPSHOT
sumup.adder.bootstrap-server: kafka:9092
sumup.adder.client-id: adder-2
sumup.adder.commit-interval: 3s
+ sumup.adder.throttle: 3ms
spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017
spring.data.mongodb.database: juplo
- logging.level.org.apache.kafka.clients.consumer: DEBUG
peter:
image: juplo/toolbox
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import java.time.Clock;
+ import java.util.Optional;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
private final AdderResults adderResults;
private final StateRepository stateRepository;
private final String id;
- private final Consumer<String, String> consumer;
+ private final String topic;
+ private final Clock clock;
+ private final Duration commitInterval;
+ private final Consumer consumer;
private final Set<Integer> partitions = new HashSet<>();