diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java b/connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java
index 36b39bdb58cb0..6c211d84e0f1d 100644
--- a/connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java
+++ b/connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java
@@ -646,7 +646,7 @@ public void putTargetState(String connector, TargetState state) {
byte[] serializedTargetState = converter.fromConnectData(topic, TARGET_STATE_V1, connectTargetState);
log.debug("Writing target state {} for connector {}", state, connector);
try {
- configLog.send(TARGET_STATE_KEY(connector), serializedTargetState).get(READ_WRITE_TOTAL_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+ configLog.sendWithReceipt(TARGET_STATE_KEY(connector), serializedTargetState).get(READ_WRITE_TOTAL_TIMEOUT_MS, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
log.error("Failed to write target state to Kafka", e);
throw new ConnectException("Error writing target state to Kafka", e);
@@ -798,7 +798,7 @@ private void sendPrivileged(List
+ * This is a useful utility that has been used outside of Connect. This isn't in Connect's public API, + * but we've tried to maintain the method signatures and backward compatibility since early Kafka versions. + *
*/ public class KafkaBasedLog+ * This method exists for backward compatibility reasons and delegates to the newer + * {@link #sendWithReceipt(Object, Object)} method that returns a future. + * @param key the key for the {@link ProducerRecord} + * @param value the value for the {@link ProducerRecord} + */ + public void send(K key, V value) { + sendWithReceipt(key, value); + } + + /** + * Send a record asynchronously to the configured {@link #topic}. + *
+ * This method exists for backward compatibility reasons and delegates to the newer
+ * {@link #sendWithReceipt(Object, Object, org.apache.kafka.clients.producer.Callback)} method that returns a future.
+ * @param key the key for the {@link ProducerRecord}
+ * @param value the value for the {@link ProducerRecord}
+ * @param callback the callback to invoke after completion; can be null if no callback is desired
+ */
+ public void send(K key, V value, org.apache.kafka.clients.producer.Callback callback) {
+ sendWithReceipt(key, value, callback);
+ }
+
/**
* Send a record asynchronously to the configured {@link #topic} without using a producer callback.
* @param key the key for the {@link ProducerRecord}
@@ -359,12 +388,12 @@ public Future