From: Kai Moritz Date: Sun, 1 Nov 2020 20:58:07 +0000 (+0100) Subject: Made the polling-interval configurable X-Git-Tag: part-2~5 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=e9fc9733c176964466d42643a2e36f7f4179df7b;p=demos%2Fkafka%2Foutbox Made the polling-interval configurable --- diff --git a/delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java b/delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java index c08cae7..79b3e02 100644 --- a/delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java +++ b/delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java @@ -44,7 +44,7 @@ public class OutboxProducer this.topic = properties.topic; } - @Scheduled(fixedDelay = 500) + @Scheduled(fixedDelayString = "${de.juplo.kafka.outbox.interval}") public void poll() { List items; diff --git a/delivery/src/main/resources/application.yml b/delivery/src/main/resources/application.yml index 2a8502a..f090eff 100644 --- a/delivery/src/main/resources/application.yml +++ b/delivery/src/main/resources/application.yml @@ -8,6 +8,12 @@ spring: flyway: locations: classpath:db/migration/h2 +de: + juplo: + kafka: + outbox: + interval: 500 + logging: level: de: @@ -50,4 +56,5 @@ de: kafka: outbox: bootstrap-servers: localhost:9092 + interval: 2000