Made the polling-interval configurable
authorKai Moritz <kai@juplo.de>
Sun, 1 Nov 2020 20:58:07 +0000 (21:58 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 1 Nov 2020 20:58:07 +0000 (21:58 +0100)
delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java
delivery/src/main/resources/application.yml

index c08cae7..79b3e02 100644 (file)
@@ -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<OutboxItem> items;
index 2a8502a..f090eff 100644 (file)
@@ -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