Old entries are removed from the outbox-table in batches
[demos/kafka/outbox] / delivery / src / main / java / de / juplo / kafka / outbox / delivery / Application.java
index 6abd181..111c6b4 100644 (file)
@@ -3,14 +3,26 @@ package de.juplo.kafka.outbox.delivery;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
+import java.time.Clock;
+
 
 @SpringBootApplication
 @EnableConfigurationProperties(ApplicationProperties.class)
 @EnableScheduling
 public class Application
 {
+  @Bean
+  public OutboxProducer outboxProducer(
+      ApplicationProperties properties,
+      OutboxRepository repository)
+  {
+    return new OutboxProducer(properties, repository, Clock.systemDefaultZone());
+  }
+
+
   public static void main(String[] args) throws Exception
   {
     SpringApplication.run(Application.class, args);