From e1ac5071ac93221a5a030e8e0c842d17b48d64a1 Mon Sep 17 00:00:00 2001 From: jruaux Date: Sat, 20 Apr 2024 17:02:00 -0700 Subject: [PATCH] feat: Added logging for replicated keys --- .../redis/riot/core/LoggingWriteListener.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 core/riot-core/src/main/java/com/redis/riot/core/LoggingWriteListener.java diff --git a/core/riot-core/src/main/java/com/redis/riot/core/LoggingWriteListener.java b/core/riot-core/src/main/java/com/redis/riot/core/LoggingWriteListener.java new file mode 100644 index 000000000..1a993f8d2 --- /dev/null +++ b/core/riot-core/src/main/java/com/redis/riot/core/LoggingWriteListener.java @@ -0,0 +1,21 @@ +package com.redis.riot.core; + +import java.util.function.Consumer; + +import org.springframework.batch.core.ItemWriteListener; +import org.springframework.batch.item.Chunk; + +public class LoggingWriteListener implements ItemWriteListener { + + private final Consumer> consumer; + + public LoggingWriteListener(Consumer> log) { + this.consumer = log; + } + + @Override + public void afterWrite(Chunk items) { + consumer.accept(items); + } + +}