Skip to content

Commit 118be5e

Browse files
committed
Make KafkaItemWriter extensible and document its thread-safety
Resolves #3970
1 parent ef5ef1e commit 118be5e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/kafka/KafkaItemWriter.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2022 the original author or authors.
2+
* Copyright 2019-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,6 +33,10 @@
3333
* with default topic configured.
3434
* </p>
3535
*
36+
* <p>
37+
* This writer is <b>not</b> thread-safe.
38+
* </p>
39+
*
3640
* @author Mathieu Ouellet
3741
* @author Mahmoud Ben Hassine
3842
* @since 4.2
@@ -42,7 +46,7 @@ public class KafkaItemWriter<K, T> extends KeyValueItemWriter<K, T> {
4246

4347
protected KafkaTemplate<K, T> kafkaTemplate;
4448

45-
private final List<CompletableFuture<SendResult<K, T>>> completableFutures = new ArrayList<>();
49+
protected final List<CompletableFuture<SendResult<K, T>>> completableFutures = new ArrayList<>();
4650

4751
private long timeout = -1;
4852

0 commit comments

Comments
 (0)