From 118be5e00215389278dbe65bc6eeebffebc77340 Mon Sep 17 00:00:00 2001
From: Mahmoud Ben Hassine
Date: Tue, 9 May 2023 10:17:58 +0200
Subject: [PATCH] Make KafkaItemWriter extensible and document its
thread-safety
Resolves #3970
---
.../springframework/batch/item/kafka/KafkaItemWriter.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/kafka/KafkaItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/kafka/KafkaItemWriter.java
index c494b9333..a542bd87c 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/kafka/KafkaItemWriter.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/kafka/KafkaItemWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2022 the original author or authors.
+ * Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,10 @@ import java.util.concurrent.TimeUnit;
* with default topic configured.
*
*
+ *
+ * This writer is not thread-safe.
+ *
+ *
* @author Mathieu Ouellet
* @author Mahmoud Ben Hassine
* @since 4.2
@@ -42,7 +46,7 @@ public class KafkaItemWriter extends KeyValueItemWriter {
protected KafkaTemplate kafkaTemplate;
- private final List>> completableFutures = new ArrayList<>();
+ protected final List>> completableFutures = new ArrayList<>();
private long timeout = -1;