From 66323d51aba6e1ce9723f86232e7b29e40d15caa Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 1 Nov 2020 21:58:07 +0100 Subject: [PATCH] Made the polling-interval configurable --- .../de/juplo/kafka/outbox/delivery/OutboxProducer.java | 2 +- delivery/src/main/resources/application.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 -- 2.20.1